[Datetime-SIG] Local time disambiguation proposal

Carl Meyer carl at oddbird.net
Fri Jul 31 17:36:32 CEST 2015


On 07/31/2015 09:22 AM, Alexander Walters wrote:
...
> "Is this instance of time DST?  Oh, it has a member attribute 'is_dst',
> let me print that and see..."

That's a great reason _not_ to name the proposed attribute `is_dst`,
because it does not answer the question "is this datetime DST?", and
isn't intended to.

The intent is to disambiguate times within the overlap resulting from a
UTC-offset fallback, whether from DST or any other change in a
timezone's UTC offset.

> "I need to tell python this time I am inputting is DST.  ...I will pass
> True to the is_dst argument"
> 
> "I am in the northern hemisphere and need to construct a date in the
> middle of july.  My nation-state observes DST.  ...what the hell do i do
> with a 'first' argument?"

If you are constructing a datetime in the middle of July, you have no
need to set this attribute, because there are no ambiguous times in the
middle of July.

Your tzinfo (if it's useful) already knows that July is DST in your
timezone, it doesn't need you to set any attribute manually.

Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150731/0af31728/attachment.sig>


More information about the Datetime-SIG mailing list