PHP date() to Rust chrono.
20 of 24 fields map cleanly; 4 have no Rust chrono token.
Rust chrono
%y%y%y%y-%b%b-%d%d %H%H:%m%m
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() | Rust chrono | Field | Example |
|---|---|---|---|
| Y | %Y | Four-digit year | 2006 |
| y | %y | Two-digit year | 06 |
| n | no token | Month number | 1 |
| m | %m | Month number, padded | 01 |
| M | %b | Month name, abbreviated | Jan |
| F | %B | Month name, full | January |
| j | no token | Day of month | 2 |
| d | %d | Day of month, padded | 02 |
| D | %a | Weekday, abbreviated | Mon |
| l | %A | Weekday, full | Monday |
| W | %V | Week of year | 1 |
| o | %G | ISO week-based year | 2006 |
| G | no token | Hour, 24-hour clock | 15 |
| H | %H | Hour, 24-hour clock, padded | 15 |
| g | no token | Hour, 12-hour clock | 3 |
| h | %I | Hour, 12-hour clock, padded | 03 |
| A | %p | AM/PM marker | PM |
| i | %M | Minute, padded | 04 |
| s | %S | Second, padded | 05 |
| v | %.3f | Fractional seconds | 000 |
| O | %z | UTC offset, basic | -0700 |
| P | %:z | UTC offset, extended | -07:00 |
| T | %Z | Time-zone name, short | MST |
| U | %s | Unix timestamp | 1136239445 |