From alexander.belopolsky at gmail.com Fri Oct 2 19:45:18 2015 From: alexander.belopolsky at gmail.com (Alexander Belopolsky) Date: Fri, 2 Oct 2015 13:45:18 -0400 Subject: [Datetime-SIG] Add strptime directives to parse ISO calendar dates Message-ID: This feature has been proposed four years ago and a complete patch is available at the bug tracker. [1] I think this is a nice feature to have and the latest patch looks good, but it will be helpful to have the patch reviewed by someone who will actually benefit from this feature. [1]: http://bugs.python.org/issue12006 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.belopolsky at gmail.com Wed Oct 21 23:27:44 2015 From: alexander.belopolsky at gmail.com (Alexander Belopolsky) Date: Wed, 21 Oct 2015 17:27:44 -0400 Subject: [Datetime-SIG] Visualizing the DST transitions Message-ID: I just wanted to share a slide [1] I came across that is very similar to the sketches in PEP 495. Does anyone understand how CCTZ handles the discontinuities? [1]: https://docs.google.com/presentation/d/1H1tkvg_vm39jXPZbOvQLoWb32POSpTYiZx8qMtBvdSQ/pub?start=false&loop=false&delayms=3000&slide=id.gdfc9fbb2b_0_74 -------------- next part -------------- An HTML attachment was scrubbed... URL: From guido at python.org Wed Oct 21 23:29:58 2015 From: guido at python.org (Guido van Rossum) Date: Wed, 21 Oct 2015 14:29:58 -0700 Subject: [Datetime-SIG] Visualizing the DST transitions In-Reply-To: References: Message-ID: Heh, they swapped the X and Y axes. :-) On Wed, Oct 21, 2015 at 2:27 PM, Alexander Belopolsky < alexander.belopolsky at gmail.com> wrote: > I just wanted to share a slide > > [1] I came across that is very similar to the sketches in PEP 495. Does > anyone understand how CCTZ handles the discontinuities? > > [1]: > https://docs.google.com/presentation/d/1H1tkvg_vm39jXPZbOvQLoWb32POSpTYiZx8qMtBvdSQ/pub?start=false&loop=false&delayms=3000&slide=id.gdfc9fbb2b_0_74 > > _______________________________________________ > Datetime-SIG mailing list > Datetime-SIG at python.org > https://mail.python.org/mailman/listinfo/datetime-sig > The PSF Code of Conduct applies to this mailing list: > https://www.python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.belopolsky at gmail.com Wed Oct 21 23:42:15 2015 From: alexander.belopolsky at gmail.com (Alexander Belopolsky) Date: Wed, 21 Oct 2015 17:42:15 -0400 Subject: [Datetime-SIG] Visualizing the DST transitions In-Reply-To: References: Message-ID: On Wed, Oct 21, 2015 at 5:29 PM, Guido van Rossum wrote: > Heh, they swapped the X and Y axes. :-) Right, but despite that, it looks like they use the same default rules for local to absolute conversions as we do in PEP 495 datetime.timestamp(). -------------- next part -------------- An HTML attachment was scrubbed... URL: From carl at oddbird.net Wed Oct 21 23:42:26 2015 From: carl at oddbird.net (Carl Meyer) Date: Wed, 21 Oct 2015 15:42:26 -0600 Subject: [Datetime-SIG] Visualizing the DST transitions In-Reply-To: References: Message-ID: <562806C2.8030204@oddbird.net> On 10/21/2015 03:27 PM, Alexander Belopolsky wrote: > I just wanted to share a slide > > [1] I came across that is very similar to the sketches in PEP 495. Does > anyone understand how CCTZ handles the discontinuities? It provides two APIs, MakeTime and MakeTimeInfo, which both accept a "naive datetime" and a timezone. MakeTime returns an absolute time, and discontinuities are handled by always assuming the pre-transition offset: https://github.com/google/cctz/blob/master/src/cctz.h#L131 MakeTimeInfo returns a more complex TimeInfo struct which has a `kind` enum member that can be `UNIQUE` (the normal case), `SKIPPED`, or `REPEATED`, and has `pre`, `post`, and `trans` timestamp members (containing the time calculated using the pre-transition offset, the time calculated using the post-transition offset, and the time at which the transition occurs), which in the normal case of `UNIQUE` are all set to the same value. Documentation starts here: https://github.com/google/cctz/blob/master/src/cctz.h#L142 Carl -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: