Timezone issue
Kayden-lolasery opened this issue · 1 comments
Kayden-lolasery commented
Describe the bug
UTC to UTC + 8 is not working as intended (it is an hour behind)
How to Reproduce
import pytz
# argus_path is a s3 path
zzzzz = wr.s3.describe_objects(argus_path, last_modified_begin=dt(2024, 7, 20, 19, 0, tzinfo=pytz.timezone('Asia/Singapore')))
print([zzzzz[i]['LastModified'] +timedelta(hours=8) for i in zzzzz])
Expected behavior
i would expect last_modified_begin=dt(2024, 7, 20, 19, 0, tzinfo=pytz.timezone('Asia/Singapore')) to give me everything including and after 7pm but it doesnt.
Your project
No response
Screenshots
OS
Win
Python version
3.9
AWS SDK for pandas version
3.2.1
Additional context
No response
Kayden-lolasery commented
seems like pytz library changed in behaviour ... perhaps it does some DST during its conversion.
specifying a datetime pytz's timezone object results in:
<DstTzInfo 'Asia/Singapore' LMT+6:55:00 STD>
while the dt.now() timezone object results in:
<DstTzInfo 'Asia/Singapore' +08+8:00:00 STD>
I'll use zoneinfo.ZoneInfo instead.