时间相关

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

posted @ 2015-05-02 12:03  yesecongcong  阅读(145)  评论(0)    收藏  举报