News for hackers. Stuff that matters.
Re:Maya – Python Datetimes for Humans by tokenizerrr on Sunday December 18, 2016 @09:24AM (#13205877)
How would you serialize that range to, for example, ISO8601?
Re:Maya – Python Datetimes for Humans by cheapsteak on Sunday December 18, 2016 @09:35AM (#13205916)
From 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

Re:Maya – Python Datetimes for Humans by BoppreH on Sunday December 18, 2016 @09:38AM (#13205925)
Excellent question. ISO 8601 has features to encode 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.