Next: Free-Form Dates, Previous: ISO 8601, Up: Date Formats [Contents][Index]
When displaying a date, the current date format is used. All characters except for letters and ‘<’ and ‘>’ are copied literally when dates are formatted. The portion between ‘< >’ markers is omitted for pure dates, or included for date/time forms. Letters are interpreted according to the table below.
When dates are read in during algebraic entry, Calc first tries to match the input string to the current format either with or without the time part. The punctuation characters (including spaces) must match exactly; letter fields must correspond to suitable text in the input. If this doesn’t work, Calc checks if the input is a simple number; if so, the number is interpreted as a number of days since Dec 31, 1 BC. Otherwise, Calc tries a much more relaxed and flexible algorithm which is described in the next section.
Weekday names are ignored during reading.
Two-digit year numbers are interpreted as lying in the range from 1941 to 2039. Years outside that range are always entered and displayed in full. Year numbers with a leading ‘+’ sign are always interpreted exactly, allowing the entry and display of the years 1 through 99 AD.
Here is a complete list of the formatting codes for dates:
Year: “91” for 1991, “7” for 2007, “+23” for 23 AD.
Year: “91” for 1991, “07” for 2007, “+23” for 23 AD.
Year: “91” for 1991, “ 7” for 2007, “+23” for 23 AD.
Year: “1991” for 1991, “23” for 23 AD.
Year: “1991” for 1991, “+23” for 23 AD.
Year: “1991” for 1991, “0023” for 23 AD, “0000” for 1 BC.
Year: ISO 8601 week-numbering year.
Year: “ad” or blank.
Year: “AD” or blank.
Year: “ad ” or blank. (Note trailing space.)
Year: “AD ” or blank.
Year: “a.d.” or blank.
Year: “A.D.” or blank.
Year: “bc” or blank.
Year: “BC” or blank.
Year: “ bc” or blank. (Note leading space.)
Year: “ BC” or blank.
Year: “b.c.” or blank.
Year: “B.C.” or blank.
Month: “8” for August.
Month: “08” for August.
Month: “ 8” for August.
Month: “AUG” for August.
Month: “Aug” for August.
Month: “aug” for August.
Month: “AUGUST” for August.
Month: “August” for August.
Day: “7” for 7th day of month.
Day: “07” for 7th day of month.
Day: “ 7” for 7th day of month.
Weekday: “0” for Sunday, “6” for Saturday.
Weekday: “1” for Monday, “7” for Sunday.
Weekday: “SUN” for Sunday.
Weekday: “Sun” for Sunday.
Weekday: “sun” for Sunday.
Weekday: “SUNDAY” for Sunday.
Weekday: “Sunday” for Sunday.
Week number: ISO 8601 week number, “W01” for week 1.
Day of year: “34” for Feb. 3.
Day of year: “034” for Feb. 3.
Day of year: “ 34” for Feb. 3.
Letter: Literal “T”.
Hour: “5” for 5 AM; “17” for 5 PM.
Hour: “05” for 5 AM; “17” for 5 PM.
Hour: “ 5” for 5 AM; “17” for 5 PM.
Hour: “5” for 5 AM and 5 PM.
Hour: “05” for 5 AM and 5 PM.
Hour: “ 5” for 5 AM and 5 PM.
AM/PM: “a” or “p”.
AM/PM: “A” or “P”.
AM/PM: “am” or “pm”.
AM/PM: “AM” or “PM”.
AM/PM: “a.m.” or “p.m.”.
AM/PM: “A.M.” or “P.M.”.
Minutes: “7” for 7.
Minutes: “07” for 7.
Minutes: “ 7” for 7.
Seconds: “7” for 7; “7.23” for 7.23.
Seconds: “07” for 7; “07.23” for 7.23.
Seconds: “ 7” for 7; “ 7.23” for 7.23.
Optional seconds: “07” for 7; blank for 0.
Optional seconds: “ 7” for 7; blank for 0.
Numeric date/time: “726842.25” for 6:00am Wed Jan 9, 1991.
Numeric date: “726842” for any time on Wed Jan 9, 1991.
Julian date/time: “2448265.75” for 6:00am Wed Jan 9, 1991.
Julian date: “2448266” for any time on Wed Jan 9, 1991.
Unix time: “663400800” for 6:00am Wed Jan 9, 1991.
Brackets suppression. An “X” at the front of the format causes the surrounding ‘< >’ delimiters to be omitted when formatting dates. Note that the brackets are still required for algebraic entry.
If “SS” or “BS” (optional seconds) is preceded by a colon, the colon is also omitted if the seconds part is zero.
If “bb,” “bbb” or “bbbb” or their upper-case equivalents appear in the format, then negative year numbers are displayed without a minus sign. Note that “aa” and “bb” are mutually exclusive. Some typical usages would be ‘YYYY AABB’; ‘AAAYYYYBBB’; ‘YYYYBBB’.
The formats “YY,” “YYYY,” “MM,” “DD,” “ddd,” “hh,” “HH,” “mm,” “ss,” and “SS” actually match any number of digits during reading unless several of these codes are strung together with no punctuation in between, in which case the input must have exactly as many digits as there are letters in the format.
The “j,” “J,” and “U” formats do not make any time zone adjustment. They effectively use ‘julian(x,0)’ and ‘unixtime(x,0)’ to make the conversion; see Date Arithmetic.
Next: Free-Form Dates, Previous: ISO 8601, Up: Date Formats [Contents][Index]