Let's look at some weirder stuff! By convention:
0000 = Year 1 BCE
0001 = Year 1 CE
To express years before 0000 or after 9999, you prefix the year with - or +:
-752 = Year 753 BCE
+30000 = Year 30000
You can denote a week date like this:
2020-W07 = The week with the 7th Thursday of the year in it.
An equivalent definition: ISO week number 1 is the first one where a majority of the week's days (starting with Monday) are in the respective year!
You can also denote the n-th day of a certain ISO week – again, starting with Monday:
2020-W07-6 = 6th day of the 7th week of 2020 = 2020-02-15
This is so weird, I've never seen this, but I actually have a use case (for weekly planning)!
Times can be added after a "T", in 24-hour format:
For more precision, add seconds:
For less precision, drop the minutes:
RFC 3339, a standard for date and time notations for Internet protocols (which is mostly a subset of ISO 8601) also allows separating date and time with other characters, like a space, and I often do that for better readability. But ISO 8601 does not allow that. :P
When to time zone information is present, the time is assumed to be in local time.
Add a "Z" for a time in UTC (apparently, this comes from nautical time notation where Z is used for the "zero zone"):
13:37Z = 13:37 in Coordinated Universal Time
UTC offsets can be appended with a + or - in the form "hh:mm", "hhmm" or "hh":
13:37+01 = 13:37 in (for example) Central European Time
13:37+05:30 = 13:37 in (for example) Indian Standard Time
Instead of adding "Z", adding "+00" is also possible.
There's a syntax for specifying durations! They start with "P" for period, followed by the number of Y(ears), M(onths), W(eeks), D(ays). Then, after a "T", you can list the number of H(ours), M(inutes) and S(econds):
P4Y = 4 years
PT48H = 48 hours
P1YT1S = 1 year and 1 second
And finally, the interval syntax I was looking for: use a "/" (or a "--" in filenames) to separate the start and end value. You can omit redundant elements from the beginning of the end value:
2020-02-10/16 = February 10 to 16
2020-01-15/02-15 = January 15 to February 15
You can also use a duration after the "/"!
2020-01-15/P1M = 2020-01-15/02-15
2020-02-15T13:37/PT1H = 2020-02-15T13:37/14:37
You can specify repeating intervals by adding the prefix "R/":
R/2020-02-15/P2W = Every second Saturday, starting today.
R/2019/2023 = Every 4 years, starting in 2019.
And optionally, you can specify the number of repetitions after the "R":
R100/13:37:00+01/PT1H = 100 one-hour intervals starting at 13:37 CET.
That's all I got! Back to making a list of events and their dates… in a *very concise, well-defined notation*! \:D/
@blinry thanks, I learned things about ISO8601 in this thread I had never heard about before!
@blinry Is this valid?
@ruru4143 To my understanding, there's no "double period" range notation. What would you like to express with that?
@blinry this should express every past cccongress. there are two strings because congress changed his length in 2006.
In general it should express a annual event lasting several days
@ruru4143 Oh, such a notation would be super useful, yeah! :)
@blinry wäre das Enddatum nicht eher 02-14?
@blinry wait, is this duration and recurrence syntax still ISO 8601? because it sure comes in handy!
@daniel_bohrer Yep!! :)
chaos.social – a Fediverse instance for & by the Chaos community