poezio/poezio#3472: Ensure tz is correctly set when offset is an int
Thanks lovetox! Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
2dda6b80d4
commit
0042108a67
@ -130,7 +130,7 @@ def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
|
|||||||
sec = now.second
|
sec = now.second
|
||||||
if micro is None:
|
if micro is None:
|
||||||
micro = now.microsecond
|
micro = now.microsecond
|
||||||
if offset is None:
|
if offset in (None, 0):
|
||||||
offset = tzutc()
|
offset = tzutc()
|
||||||
elif not isinstance(offset, dt.tzinfo):
|
elif not isinstance(offset, dt.tzinfo):
|
||||||
offset = tzoffset(None, offset)
|
offset = tzoffset(None, offset)
|
||||||
@ -177,7 +177,7 @@ def datetime(year=None, month=None, day=None, hour=None,
|
|||||||
sec = now.second
|
sec = now.second
|
||||||
if micro is None:
|
if micro is None:
|
||||||
micro = now.microsecond
|
micro = now.microsecond
|
||||||
if offset is None:
|
if offset in (None, 0):
|
||||||
offset = tzutc()
|
offset = tzutc()
|
||||||
elif not isinstance(offset, dt.tzinfo):
|
elif not isinstance(offset, dt.tzinfo):
|
||||||
offset = tzoffset(None, offset)
|
offset = tzoffset(None, offset)
|
||||||
|
Loading…
Reference in New Issue
Block a user