Dates, Date-Times & Date-Time-Offsets
A date-time represents a point in the time scale outside of any timezone. A date without time represents a day of the calendar outside of any timezone. A date-time-offset represents a point in the time scale based on Universal Coordinated Time (UTC). Dates and date-times are formatted according to the ISO 8601 and RFC 3339 standards, whose ABNF grammar is the following:The
Z character in the time-offset part of the string is equivalent to a +00:00 timezone offset. In other words, in indicates the date-time is UTC.Most date typed properties are suffixed with “On”, and most date-time typed properties with “At”. For example:
(date-time) createdAt, (date) occursOn, etc…Date Ranges
- a date-range
2023-01-01--2023-01-31represents the interval between two dates, outside of any timezone. Here, both the start and end date are included. - a date-time-range
2023-01-01T00:00:00--2023-01-02T00:00:00represents the interval between two points in the time scale, outside of any timezone. Here, the end date is NOT included. - a date-time-offset-range
2023-01-01T00:00:00+02:00--2023-01-02T00:00:00+02:00represents the interval between two points in the time scale, defined in reference to UTC. Here, the end date is NOT included.
In the spec, dates can be separated with the ”/” (slash) character, but this could break URLs when serializing ranges as query parameters values
?date=2023-01-01/2023-01-31, so the Lucca API does not officially support it. Besides, the Lucca API does not support ranges defined as a date and a duration either.".." characters:
..--2023-01-01: until Jan. 1st 2023 ;2023-01-01--..: since Jan. 1st 2023.
Durations (time intervals)
A duration represents the length of the interval between two points in the time scale. Duration ISO value Same as with dates and date-times, durations (or time intervals) also conform to the ISO 8601 standard, whose ABNF grammar is:P2DT12H30M23S indicates “2 days, 12 hours, 30 minutes and 23 seconds”.
Unit & Value
In time management, work durations are often handled either:
- as a number of hours,
- or as a fraction of days.