C# custom format to PHP date().
19 of 20 fields map cleanly; 1 has no PHP date() token.
PHP date()
Y-m-d H:i
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 | PHP date() | Field | Example |
|---|---|---|---|
| yyyy | Y | Four-digit year | 2006 |
| yy | y | Two-digit year | 06 |
| M | n | Month number | 1 |
| MM | m | Month number, padded | 01 |
| MMM | M | Month name, abbreviated | Jan |
| MMMM | F | Month name, full | January |
| d | j | Day of month | 2 |
| dd | d | Day of month, padded | 02 |
| ddd | D | Weekday, abbreviated | Mon |
| dddd | l | Weekday, full | Monday |
| H | G | Hour, 24-hour clock | 15 |
| HH | H | Hour, 24-hour clock, padded | 15 |
| h | g | Hour, 12-hour clock | 3 |
| hh | h | Hour, 12-hour clock, padded | 03 |
| tt | A | AM/PM marker | PM |
| mm | i | Minute, padded | 04 |
| ss | s | Second, padded | 05 |
| fff | v | Fractional seconds | 000 |
| zzz | P | UTC offset, extended | -07:00 |
| g | no token | Era | AD |