Re: [Datetime-SIG] Allow numerical arguments for timezones
11 Dec
2015
11 Dec
'15
2:20 a.m.
On Thu, Dec 10, 2015 at 8:09 PM, Guido van Rossum <guido@python.org> wrote:
The reason that timezone() takes a timedelta is to avoid mistakes in the units.
That was more or less the original reasoning. Note that an early prototype required the offset to be specified in minutes. [1] I don't expect people to have to construct timezone objects "by hand". You would normally get tzinfo populated with a local timezone by calling .astimezone() on a UTC instance:
from datetime import * dt = datetime.now(timezone.utc) print(dt.astimezone()) 2015-12-10 20:19:34.446688-05:00
3071
Age (days ago)
3071
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexander Belopolsky