Rust chrono to Java DateTimeFormatter.
21 of 22 fields map cleanly; 1 has no Java DateTimeFormatter token.
Java DateTimeFormatter
uuuu-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.
| Rust chrono | Java DateTimeFormatter | Field | Example |
|---|---|---|---|
| %Y | uuuu | Four-digit year | 2006 |
| %y | uu | Two-digit year | 06 |
| %m | MM | Month number, padded | 01 |
| %b | MMM | Month name, abbreviated | Jan |
| %B | MMMM | Month name, full | January |
| %d | dd | Day of month, padded | 02 |
| %a | EEE | Weekday, abbreviated | Mon |
| %A | EEEE | Weekday, full | Monday |
| %j | D | Day of year | 2 |
| %V | w | Week of year | 1 |
| %G | YYYY | ISO week-based year | 2006 |
| %H | HH | Hour, 24-hour clock, padded | 15 |
| %I | hh | Hour, 12-hour clock, padded | 03 |
| %p | a | AM/PM marker | PM |
| %M | mm | Minute, padded | 04 |
| %S | ss | Second, padded | 05 |
| %.3f | SSS | Fractional seconds | 000 |
| %z | Z | UTC offset, basic | -0700 |
| %:z | xxx | UTC offset, extended | -07:00 |
| %Z | z | Time-zone name, short | MST |
| %s | no token | Unix timestamp | 1136239445 |
| %q | Q | Quarter | 1 |