C# custom format to Go time layout.
18 of 20 fields map cleanly; 2 have no Go time layout token.
Go time layout
2006-01-02 15:04
Reference · Mon, Jan 2 2006, 3:04:05 PM MST
2006-01-02 15:04
2006-01-02 15:04
Right now, your zone
…
Both sides render the same instant — the translation is faithful.
| C# custom format | Go time layout | Field | Example |
|---|---|---|---|
| yyyy | 2006 | Four-digit year | 2006 |
| yy | 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 |
| ddd | Mon | Weekday, abbreviated | Mon |
| dddd | Monday | Weekday, full | Monday |
| 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 |
| tt | PM | AM/PM marker | PM |
| mm | 04 | Minute, padded | 04 |
| ss | 05 | Second, padded | 05 |
| fff | .000 | Fractional seconds | 000 |
| zzz | -07:00 | UTC offset, extended | -07:00 |
| g | no token | Era | AD |