Go time layout to C# custom format.
18 of 21 fields map cleanly; 3 have no C# custom format token.
C# custom format
yyyy-MM-dd HH:mm
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.
| Go time layout | C# custom format | Field | Example |
|---|---|---|---|
| 2006 | yyyy | Four-digit year | 2006 |
| 06 | yy | Two-digit year | 06 |
| 1 | M | Month number | 1 |
| 01 | MM | Month number, padded | 01 |
| Jan | MMM | Month name, abbreviated | Jan |
| January | MMMM | Month name, full | January |
| 2 | d | Day of month | 2 |
| 02 | dd | Day of month, padded | 02 |
| 002 | no token | Day of year | 2 |
| Mon | ddd | Weekday, abbreviated | Mon |
| Monday | dddd | Weekday, full | Monday |
| 15 | HH | Hour, 24-hour clock, padded | 15 |
| 3 | h | Hour, 12-hour clock | 3 |
| 03 | hh | Hour, 12-hour clock, padded | 03 |
| PM | tt | AM/PM marker | PM |
| 04 | mm | Minute, padded | 04 |
| 05 | ss | Second, padded | 05 |
| .000 | fff | Fractional seconds | 000 |
| -0700 | no token | UTC offset, basic | -0700 |
| -07:00 | zzz | UTC offset, extended | -07:00 |
| MST | no token | Time-zone name, short | MST |