kopia lustrzana https://github.com/micropython/micropython-lib
datetime: Add default utc tz for datetime.now().
Signed-off-by: Patrick Joy <patrick@joytech.com.au>pull/570/head
rodzic
50b7aca171
commit
c05655fac9
|
@ -635,10 +635,9 @@ class datetime:
|
||||||
else:
|
else:
|
||||||
us = 0
|
us = 0
|
||||||
if tz is None:
|
if tz is None:
|
||||||
raise NotImplementedError
|
tz = timezone.utc
|
||||||
else:
|
dt = cls(*_tmod.gmtime(ts)[:6], microsecond=us, tzinfo=tz)
|
||||||
dt = cls(*_tmod.gmtime(ts)[:6], microsecond=us, tzinfo=tz)
|
dt = tz.fromutc(dt)
|
||||||
dt = tz.fromutc(dt)
|
|
||||||
return dt
|
return dt
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Ładowanie…
Reference in New Issue