时间戳解析

分类语法解释示例
y-yearyyyyfull year number.2015
yytwo-digit year.15
M-month of the yearMminimal-digit month.1
MMtwo-digit month. 01
MMMtwo-digit month. zero-padded if needed. Jan
MMMMabbreviated month text.January
d-day of the monthdminimal-digit day.1
ddtwo-digit day, zero-padded if needed.01
H-hour of the day (24-hour clock)Hminimal-digit hour.0
HHtwo-digit hour, zero-padded if needed.00
m-minutes of the hour (60 minutes per hour)mminimal-digit minutes. 0
mmtwo-digit minutes, zero-padded if needed. 00
s-seconds of the minute (60 seconds per minute)sminimal-digit seconds.0
sstwo-digit seconds, zero-padded if needed.00
S-fraction of a second Maximum precision is milliseconds (SSS). Beyond that, zeroes are appended.Stenths of a second. 0
SShundredths of a second.01
SSSthousandths of a second. 012
Z-time zone offset or identityZTimezone offset structured as HHmm.-0700
ZZTimezone offset structured as HH:mm.-07:00
ZZZTimezone identity. America/Los_Angeles
w-week of the yearwminimal-digit week. 1
wwtwo-digit week, zero-padded if needed. 01
D-day of the year   
e-day of the week (number)   
E-day of the week (text)E, EE, EEEAbbreviated day of the week. Mon
EEEEThe full text day of the week.Monday
备注:For non-formatting syntax, you’ll need to put single-quote characters around the value. For example, if you were parsing ISO8601 time, "2015-01-01T01:12:23" that little "T" isn’t a valid time format, and you want to say "literally, a T", your format would be this: "yyyy-MM-dd’T’HH:mm:ss"

Other less common date units, such as era (G), century (C), am/pm (a), and # more, can be learned about on the joda-time documentation.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值