仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2688|回复: 18
打印 上一主题 下一主题

[学习教程] JAVA网页设计用Java做工夫的减法

[复制链接]
小女巫 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-18 11:43:01 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
市场分额,java比asp高一点,因为C#是仿照java开发的,所以哦C#能做的java都能做到,但是java能做的,C#不一定都能做到。毕竟是抄袭吗。活用GregorianCalendar类的getTimeInMillis()办法。
注重,取到的值是从1970年1月1日00:00:00入手下手算起所经由的微秒数。一秒是一千微秒。

上面是本人写的一个例程及运转了局:

importjava.util.GregorianCalendar;

classTestClender{

publicstaticvoidmain(Stringargs[]){

GregorianCalendarca=newGregorianCalendar();
System.out.println("ca:"+ca);
System.out.println("ca.time:"+ca.getTimeInMillis());

GregorianCalendarca0=newGregorianCalendar(2004-1900,11,31,23,59,59);
GregorianCalendarca1=newGregorianCalendar(2005-1900,00,01,00,00,02);
longsa=ca1.getTimeInMillis()-ca0.getTimeInMillis();
System.out.println("ca1-ca0:"+sa);

//2004.11.05added
Stringold="20041231235959";
intold_yyyy=Integer.parseInt(old.substring(0,4));
intold_mm=Integer.parseInt(old.substring(4,6));
intold_dd=Integer.parseInt(old.substring(6,8));
intold_hh=Integer.parseInt(old.substring(8,10));
intold_mi=Integer.parseInt(old.substring(10,12));
intold_ss=Integer.parseInt(old.substring(12,14));
Stringnow="20050101235959";
intnow_yyyy=Integer.parseInt(now.substring(0,4));
intnow_mm=Integer.parseInt(now.substring(4,6));
intnow_dd=Integer.parseInt(now.substring(6,8));
intnow_hh=Integer.parseInt(now.substring(8,10));
intnow_mi=Integer.parseInt(now.substring(10,12));
intnow_ss=Integer.parseInt(now.substring(12,14));
GregorianCalendargcOld=newGregorianCalendar(
old_yyyy-1900,old_mm-1,old_dd,old_hh,old_mi,old_ss);
GregorianCalendargcNow=newGregorianCalendar(
now_yyyy-1900,now_mm-1,now_dd,now_hh,now_mi,now_ss);
sa=gcNow.getTimeInMillis()-gcOld.getTimeInMillis();
System.out.println("now-old:"+sa);

}

}


由于这些智能化家电的市场需求没有预期的高,Sun放弃了该项计划。就在Oak几近失败之时,随着互联网的发展,Sun看到了Oak在计算机网络上的广阔应用前景,于是改造了Oak,
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-2 19:00

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表