Author ncoghlan
Recipients belopolsky, lemburg, ncoghlan, pitrou
Date 2012-02-22.02:27:37
SpamBayes Score 0.000186631
Marked as misclassified No
Message-id <>
Currently, datetime.timezone requires that the offset be specified explicitly.

It would be more convenient if the local offset was used by default.

Since the time module already exposes the offset details for the local timezone, this would just make:

  local_tz = datetime.timezone()

equivalent to the current complex incantation:

  local_tz = datetime.timezone(datetime.timedelta(hours=(time.timezone / -3600 + tm.tm_isdst)))

Then getting a timezone aware version of the local time would just be:

  now =

Similar to the existing spelling for UTC:

  now =

(Inspired by
Date User Action Args
2012-02-22 02:27:40ncoghlansetrecipients: + ncoghlan, lemburg, belopolsky, pitrou
2012-02-22 02:27:40ncoghlansetmessageid: <>
2012-02-22 02:27:38ncoghlanlinkissue14083 messages
2012-02-22 02:27:37ncoghlancreate