4 ms·
How would you serialize that range to, for example, ISO8601?
by tokenizerrr 10y ago
How would you serialize that range to, for example, ISO8601?
- cheapsteak 10y agoFrom wiki: ISO8601 has four ways to express a time interval: 1. Start and end, such as "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z". 2. Start and duration, such as "2007-03-01T13:00:00Z/P1Y2M10DT2H30M" 3. Duration and end, such as "P1Y2M10DT2H30M/2008-05-11T15:30:00Z" 4. Duration only, such as "P1Y2M10DT2H30M", with additional context information http://en.wikipedia.org/wiki/ISO_8601#Time_intervals http://en.wikipedia.org/wiki/ISO_8601#Time_intervals
- BoppreH 10y agoExcellent question. ISO 8601 has features to encode time intervals ( https://en.wikipedia.org/wiki/ISO_8601#Time_intervals https://en.wikipedia.org/wiki/ISO_8601#Time_intervals ). If that's too verbose, and we only need to represent integer intervals, one could store a truncated representation, where the omitted parts mean "any" (like * in cron). For example, `2016-11` could mean the entire month of November. But those are just ideas for the representation. The important feature is that not all objects are precise points in time, but may be a block/interval/range.