如何在不使用Calender.getInstance()的情况下获取当前系统的时间和日期
发布于 2011-02-23 19:09:08
试一试
Date d = new Date();
CharSequence s = DateFormat.format("EEEE, MMMM d, yyyy ", d.getTime());您可以根据需要编辑格式字符串。
发布于 2011-02-23 19:01:47
试试这个:
//-------- Don't know whether this will work on android or not.
long dtMili = System.currentTimeMillis();
Date dt = new Date(dtMili);或
new Date().getTime()发布于 2011-02-23 19:02:52
构造一个新的Date将提供当前日期。然后,您可以使用date.setTime( System.currentTimeMillis() )来更新该对象
https://stackoverflow.com/questions/5089944
复制相似问题