December 2023
Rust DateTime Formatting Examples With chrono
Just a few date formats I like to use
---
chrono = "0.4.38"
---
use *;
Output:
%Y-%m-%d %H:%M:%S | 2023-01-08 04:05:06
%Y-%m-%dT%H:%M:%S | 2023-01-08T04:05:06
%B %Y | January 2023
%b %Y | Jan 2023
%a. %B %-d - %-I:%M%p | Sun. January 8 - 4:05AM
All the specifiers are here:
end of line