Calendar Description - Scheme go
The Ordinal calendar is defined in terms of the Gregorian calendar. It consists of a count of years and days. It is also (confusingly) known as the Julian Date and the day number as the Julian Day but these terms are not recommended.
The year is identical to the Gregorian year. The day is the ordinal number of days since 1st of January in that year. The number of days in a year is 365 or 366, the same as the equivalent Gregorian year.
Use Case
Often used by modern day industry, where it may be referred to as Julian date.
Details of the scheme where published in 1973 by the International Standards Organisation in their ISO 2711:1973 document. This was superseded in 2004 by the ISO 8601:2004 and later publications.
Definition
The Ordinal calendar is defined in terms of the Gregorian calendar.
The Record consists of two Fields named year
and day
.
Record | |
---|---|
year | day |
The year length and number are the same as the g Gregorian calendar scheme. Day one is defined as 1st January.
The Epoch is set at
go | year | day |
---|---|---|
1 | 1 |
g | year | month | day |
---|---|---|---|
1 | 1 | 1 |
jdn | day |
---|---|
1721426 |
Formats
The formats supplied with this scheme.
Details of the the ISO 8601 standard format is shown in the format statement rules iso8601 section with examples to show how to extend the available formats.
Formats - Grammar go | |||||
---|---|---|---|---|---|
Code | Rule | Pseudo:in | Pseudo:out | Example | Note |
yd | text | year day | yyyy ddd | 2023 39 | D, S |
iso | iso8601 | ISO:8601 Ordinal -YYYY | -YYYY-DDD | 2023-039 | S |
def | text | year day | yyyy ddd | 2023 39 | H, S |
u | unit | 9y 9d | 9y 9d | 2023y 39d | H |
Notes: D = Default, H = Hidden, S = Range shortcut supported. Example based on jdn# 2459984 |
Script
Script - Module hics:gregorian |
---|
grammar go { name "Year Day"; fields year day; alias pseudo { ddd day; yyyy year; } alias unit { d day; y year; } format yd "{year}| {day}"; format iso { rules iso8601 ordinal minus; } preferred yd; } scheme go { name "Gregorian Ordinal"; base ordinal; grammar go; } |
The script has no dependencies.