PHP date() to Go time layout.
20 of 24 fields map cleanly; 4 have no Go time layout token.
Go time layout
06060606-JanJan-0202 1515:0101
Reference · Mon, Jan 2 2006, 3:04:05 PM MST
06060606-JanJan-0202 1515:0101
06060606-JanJan-0202 1515:0101
Right now, your zone
…
Both sides render the same instant — the translation is faithful.
| PHP date() | Go time layout | Field | Example |
|---|---|---|---|
| Y | 2006 | Four-digit year | 2006 |
| y | 06 | Two-digit year | 06 |
| n | 1 | Month number | 1 |
| m | 01 | Month number, padded | 01 |
| M | Jan | Month name, abbreviated | Jan |
| F | January | Month name, full | January |
| j | 2 | Day of month | 2 |
| d | 02 | Day of month, padded | 02 |
| D | Mon | Weekday, abbreviated | Mon |
| l | Monday | Weekday, full | Monday |
| W | no token | Week of year | 1 |
| o | no token | ISO week-based year | 2006 |
| G | no token | Hour, 24-hour clock | 15 |
| H | 15 | Hour, 24-hour clock, padded | 15 |
| g | 3 | Hour, 12-hour clock | 3 |
| h | 03 | Hour, 12-hour clock, padded | 03 |
| A | PM | AM/PM marker | PM |
| i | 04 | Minute, padded | 04 |
| s | 05 | Second, padded | 05 |
| v | .000 | Fractional seconds | 000 |
| O | -0700 | UTC offset, basic | -0700 |
| P | -07:00 | UTC offset, extended | -07:00 |
| T | MST | Time-zone name, short | MST |
| U | no token | Unix timestamp | 1136239445 |