currentTimeMillis
public static long currentTimeMillis()Returns the current time in milliseconds.
See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).Returns:
the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
public static long currentTimeMillis()Returns the current time in milliseconds.
See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).Returns:
the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
解决方案 »
- 这个this何解?
- 请教,java定期写文件问题,请教,JAVA定期写文件问题,谢谢!
- 为什么Java按钮上老是加不上图标??
- 谁帮帮我,快疯了!
- 加好友的插件,应该如何写,菜鸟一点思路都没有,请教前辈指点
- 请问Tomcat产生的404错误页,要放在那个路径下?
- 如何将Delphi中的加密解密程序改写java的加密解密程序?(源代码奉献,问题解决分可以再加)
- 为什么这个方法执行完后这个fileName文件还存在的,它怎么没有被自动删除,我不是已经设了file.deleteOnExit();吗???
- 关于JCREATE的使用
- java中将final数值定义为static和非static的区别
- 刚开始学java,问一个初级问题
- 大家帮我看看这段代码,很简单的鼠标事件
然后自己定格式输出!
Date date=null;
Calendar MyDate = Calendar.getInstance();
MyDate.setTime(new java.util.Date());
date=MyDate.getTime();
return date;
}
最标准的,也是sun推荐的。
SimpleDateFormat lFormat; lFormat = new SimpleDateFormat(rDateFormat);
gRtnStr = lFormat.format(new java.util.Date()); return gRtnStr;
}
SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
Calendar MyDate = Calendar.getInstance();
MyDate.setTime(new java.util.Date());
String adddate=df.format(MyDate.getTime()).substring(0,8);
return adddate;
}