Java DateTimeFormatter to Go time layout.
21 of 26 fields map cleanly; 5 have no Go time layout token.
Go time layout
yyyy-01-02 15:04
Reference · Mon, Jan 2 2006, 3:04:05 PM MST
yyyy-01-02 15:04
yyyy-01-02 15:04
Right now, your zone
…
Not in the Java DateTimeFormatter table: y — passed through untranslated.
| Java DateTimeFormatter | Go time layout | Field | Example |
|---|---|---|---|
| uuuu | 2006 | Four-digit year | 2006 |
| uu | 06 | Two-digit year | 06 |
| M | 1 | Month number | 1 |
| MM | 01 | Month number, padded | 01 |
| MMM | Jan | Month name, abbreviated | Jan |
| MMMM | January | Month name, full | January |
| d | 2 | Day of month | 2 |
| dd | 02 | Day of month, padded | 02 |
| D | 002 | Day of year | 2 |
| EEE | Mon | Weekday, abbreviated | Mon |
| EEEE | Monday | Weekday, full | Monday |
| w | no token | Week of year | 1 |
| YYYY | no token | ISO week-based year | 2006 |
| H | no token | Hour, 24-hour clock | 15 |
| HH | 15 | Hour, 24-hour clock, padded | 15 |
| h | 3 | Hour, 12-hour clock | 3 |
| hh | 03 | Hour, 12-hour clock, padded | 03 |
| a | PM | AM/PM marker | PM |
| mm | 04 | Minute, padded | 04 |
| ss | 05 | Second, padded | 05 |
| SSS | .000 | Fractional seconds | 000 |
| Z | -0700 | UTC offset, basic | -0700 |
| xxx | -07:00 | UTC offset, extended | -07:00 |
| z | MST | Time-zone name, short | MST |
| G | no token | Era | AD |
| Q | no token | Quarter | 1 |