Skip to content

DateOrder

How an all-numeric date reads: month first or day first.

"3/4/2026" is March 4th to an American and April 3rd to most of the rest of the world. Nothing in the text itself can settle it — so the reader asks you, with a DateOrder parameter. Only ambiguous shapes use it: ISO 8601 and bare "20260304" read the same everywhere, and a value whose first part has four digits is year-first no matter what you pass.

Members

Member Meaning
MonthFirst The US reading: "3/4/2026" is March 4th. This is the default.
DayFirst The European reading: "3/4/2026" is April 3rd.

Where it is used

The date readers on CkDate (ToDateOnly, ToDateTime and their OrNull twins, plus Format when it reads text) and the date readers on CkDictionary all take an order parameter.

Quick look

using SafeCoder.CommonKit;
using SafeCoder.CommonKit.Enums;

CkDate.ToDateOnly("3/4/2026");        // -> 2026-03-04  (month first is the default)

CkDate.ToDateOnly(
    input: "3/4/2026",
    order: DateOrder.DayFirst
);                                    // -> 2026-04-03