Product Site

5.4.6.8. fromOrdinalDate (Class Method)

Returns a new DateTime object, created from a string in ISO ordinal date format. The time component will be set to 00:00:00.000000.

Both the basic format yyyyddd and the extended format yyyy-ddd are accepted, where ddd is the ordinal number of a day within year yyyy. The allowed range for ddd is 1 through the number of days in year yyyy, which is either 365 or 366. Leading zeros are required for both yyyy and ddd.

If specified, offset is the offset from UTC, in minutes. The offset must be a valid whole number between -900 and 900 or an equivalent TimeSpan instance. The default offset is the current system timezone offset.

See also method ordinalDate.

Example 5.228. DateTime class — fromOrdinalDate method
say .DateTime~fromOrdinalDate("2020-041")    -- 2020-02-10T00:00:00.000000