You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am having a problem related to Tz Conversion. I found that using pytz.timezone() with astimezone() method generates invalid timezone conversion adding some extra minutes to the final value.
Here is the example to replicate the problem:
importdatetimeimportpytzfromdateutilimporttzdt_sao_paulo=datetime.datetime(2024, 1, 1, 10, 10, tzinfo=pytz.timezone('America/Sao_Paulo'))
dt_utc=dt_sao_paulo.astimezone(pytz.utc)
print(dt_utc)
# same conversion with different libdt_sao_paulo=datetime.datetime(2024, 1, 1, 10, 10, tzinfo=tz.gettz('America/Sao_Paulo'))
dt_utc=dt_sao_paulo.astimezone(tz.UTC)
print(dt_utc)
Hi, I am having a problem related to Tz Conversion. I found that using
pytz.timezone()
withastimezone()
method generates invalid timezone conversion adding some extra minutes to the final value.Here is the example to replicate the problem:
The result printed:
The first one added 6 minutes to the final datetime.
The text was updated successfully, but these errors were encountered: