[Datetime-SIG] Clearing up terminology
ISAAC J SCHWABACHER
ischwabacher at wisc.edu
Thu Jul 30 00:04:28 CEST 2015
For perspective, here's what we *could* have been dealing with if Guido and Tim had been less Dutch:
<http://blog.nodatime.org/2011/08/what-wrong-with-datetime-anyway.html>
http://blog.nodatime.org/2011/08/what-wrong-with-datetime-anyway.html
(My favorite snippet so far:
I don't know about you, but this sort of thing gives me the semantic heebie-jeebies. It's like having a "number" type which has a sequence of digits - but you have to ask another property whether those digits are hex or decimal, and the answer can sometimes be "Well, what do you think?"
)
ijs
________________________________
From: Datetime-SIG <datetime-sig-bounces+ischwabacher=wisc.edu at python.org> on behalf of Felipe Ochoa <felipe.nospam.ochoa at gmail.com>
Sent: Wednesday, July 29, 2015 16:31
To: datetime-sig
Subject: [Datetime-SIG] Clearing up terminology
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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150729/b34fabf1/attachment-0001.html>
More information about the Datetime-SIG
mailing list