`
wandejun1012
  • 浏览: 2695326 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

java 日期格式 毫秒

    博客分类:
  • java
 
阅读更多

参考URL:http://www.busfly.net/csdn/post/java_string_fomat_date_time_simpledateformat.html

关键代码:

 

java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");

 

JAVA中各种日期表示字母如下:

 

 

 

字母 日期或时间元素 表示 示例
G Era 标志符 Text AD
y Year 199696
M 年中的月份 Month JulyJul07
w 年中的周数 Number 27
W 月份中的周数 Number 2
D 年中的天数 Number 189
d 月份中的天数 Number 10
F 月份中的星期 Number 2
E 星期中的天数 Text TuesdayTue
a Am/pm 标记 Text PM
H 一天中的小时数(0-23) Number 0
k 一天中的小时数(1-24) Number 24
K am/pm 中的小时数(0-11) Number 0
h am/pm 中的小时数(1-12) Number 12
m 小时中的分钟数 Number 30
s 分钟中的秒数 Number 55
S 毫秒数 Number 978
z 时区 General time zone Pacific Standard TimePSTGMT-08:00
Z 时区 RFC 822 time zone -0800

 

 

 

分享到:
评论
1 楼 lijunwyf41 2014-03-28  
不错,实用

相关推荐

Global site tag (gtag.js) - Google Analytics