[Datetime-SIG] Clearing up terminology

Łukasz Rekucki lrekucki at gmail.com
Thu Jul 30 00:23:32 CEST 2015


On 29 July 2015 at 23:31, Felipe Ochoa <felipe.nospam.ochoa at gmail.com> wrote:
> Jon Skeet has created what I think would be a very useful guide for people
> on this list to read. He provides some great (precisely defined) terminology
> we should adopt to move away from "naive" and "aware." Hopefully this will
> ease some of the communication difficulties we're experiencing.
>
> http://nodatime.org/1.2.x/userguide/concepts.html
>
>
>
> TL;DR: here's a glossary of terms:
>
> * local vs global: "The key difference is that people all around the world
> will agree on a global value simultaneously, whereas they may all see
> different local values for the same global value, due to time zones." Local
> values are what Guido has labeled "naive" -- in the sense that they don't
> have a datetime.
>
> * Instant: a point on the non-relativistic time line. Isomorphic to "the
> number of seconds since the unix epoch". It doesn't make sense to talk about
> time zones with instants
>
> * Calendar system: a means of breaking up the time line into "units such as
> years, months, days, hours, minutes, and so on"
>
> * Time zone: "a mapping from UTC instants to offsets"
>
> * Offset: "simply the difference between UTC and local time."
>
> * ZonedDatetime: An instant + a time zone
>
> * OffsetDatetime: An instant + an offset (which is not the same as a
> ZonedDatetime!)
>
> * LocalDatetime: A date/time in the usual "naive" sense: a combination of
> year, month, day, hour, minute, second, millisecond (soon to be nano?)
>
> * Duration: The difference between two instants. "A fixed number of ticks".
> What has also been called "stopwatch deltas". Skeet says, "it's the same
> length of time wherever it's applied. Duration is used for arithmetic on
> Instant and DateTime values."
>
> * Period: "a set of values associated with different calendar-based periods:
> years, months, weeks, days, hours, minutes and so on. Some of these periods
> represent different lengths of time depending on what they're applied to."
>

Just for the record, NodaTime is a C# port of JodaTime[1] which was
the base for "java.time" module I mentioned earlier in the python-dev
discussion, so the shared terminology is not a coicidence ;)

It's worth noting that, in this libraries, adding a "Duration" to a
"ZonedDateTime" always moves it on the timeline by a fixed amount
(Noda time seems to call it "time line arithmetic"). This is what
PEP-431 advertises for, but which was considered against the design of
datetime.

[1]: http://www.joda.org/joda-time/
[2]: http://nodatime.org/1.3.x/userguide/arithmetic.html

-- 
Łukasz Rekucki


More information about the Datetime-SIG mailing list