Rust chrono to C# custom format.

15 of 22 fields map cleanly; 7 have no C# custom format token.

C# custom format

yyyy-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 chronoC# custom formatFieldExample
%YyyyyFour-digit year2006
%yyyTwo-digit year06
%mMMMonth number, padded01
%bMMMMonth name, abbreviatedJan
%BMMMMMonth name, fullJanuary
%dddDay of month, padded02
%adddWeekday, abbreviatedMon
%AddddWeekday, fullMonday
%jno tokenDay of year2
%Vno tokenWeek of year1
%Gno tokenISO week-based year2006
%HHHHour, 24-hour clock, padded15
%IhhHour, 12-hour clock, padded03
%pttAM/PM markerPM
%MmmMinute, padded04
%SssSecond, padded05
%.3ffffFractional seconds000
%zno tokenUTC offset, basic-0700
%:zzzzUTC offset, extended-07:00
%Zno tokenTime-zone name, shortMST
%sno tokenUnix timestamp1136239445
%qno tokenQuarter1