stay
取得系统时间
1。
long time=System.currentTimeMillis();

2。
final Calendar mCalendar=Calendar.getInstance();
mCalendar.setTimeInMillis(time);
取得小时:mHour=mCalendar.get(Calendar.HOUR);
取得分钟:mMinuts=mCalendar.get(Calendar.MINUTE);


3。
Time t=new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料
t.setToNow(); // 取得系统时间。
int year = t.year;
int month = t.month;
int date = t.monthDay;
int hour = t.hour;    // 0-23

4。
DateFormat df = new SimpleDateFormat("HH:mm:ss");
df.format(new Date());

分类:

技术点:

相关文章:

  • 2021-08-07
  • 2022-01-02
  • 2021-11-24
  • 2021-08-07
  • 2021-10-29
  • 2021-11-18
  • 2021-11-28
猜你喜欢
  • 2021-11-07
  • 2021-11-07
  • 2021-11-07
  • 2021-11-18
  • 2021-09-30
  • 2021-09-30
  • 2021-11-06
相关资源
相似解决方案