首页 > 其他 > 详细

时间相关

时间:2015-05-02 12:26:56      阅读:205      评论:0      收藏:0      [点我收藏+]

new date(longmills);calendar.setTimeInMillis(longmills);
system.currentTimeMills();
systemClock.uptimeMills();
Calendar calendar=Calendar.getInstance(),calendar.get(Calendar.Year) calendar.get(Calendar.Month) calendar.get(Calendar.Day);
字符串转化为毫秒值 simpleDateFormat.parse(timeStr).getTime();
calendar.getTime();???
Time time=new Time()//time=new Time("GMT+8");
time.setToNow(); time.year; time.month,time.monthDay time.hour time.minute time.seconds
calendar.get(Calendar.Day_of_week);

SimpledateFormat simpleDateFormat.format(new date())时间转化为字符串,simpledateFormat.parse();字符串转化为日期
calendar.setTime(dateFormat.parse(ssss));
date.getTime()获得longmills
String str = t.format("%Y%m%dT%H%M%S"); //20140103T155737

//等同于 t.format2445()方法。

解析一个日期/时间格式的字符串:

t.parse("20101010T151133");

str = t.format2445(); //20101010T121133
time.format("%Y-%m-%d %H:%M:%S")
time.format("%Y%m%dT%H%M%S")
time.format2445()
// time.format3339(boolean allDay)。如果allDay为true,则输出Y-M-D格式
31 // 如过allDay为false并且时区为UTC,则输出 Y-M-D-T-H-M-S UTC
32 // 否则输出 Y-M-D-T-H-M-S +- GMT

http://blog.csdn.net/xubright/article/details/8282829

时间相关

原文:http://www.cnblogs.com/hanyong/p/4471785.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!