JDK date formatting pit


When the date format, yyyy is the year where the day, and YYYY is the capital of a week in which year, which means the year in which the day of the week belongs, beginning from Sunday, end of the week Saturday, just this week, New Year's Eve, returned the YYYY is the next year.
Also note 3:
4 is the month uppercase M
. 5 minutes is represented by lowercase m
624 hour is uppercase H
712 hour is lowercase h

If Y is the year will be the year this week, y is the standard of the year. This official document did not explain, they still pay attention to their own point of it, the time after the transition date format remember or use "yyyy-MM-dd HH: mm: ss" format

Released seven original articles · won praise 6 · views 637

Guess you like

Origin blog.csdn.net/weixin_36273267/article/details/103863199