I'm trying to convert string timestamps to polars datetime from the timestamps my camera puts in it RAW file metadata, but polars throws this error when I have timestamps from both summer time and winter time.
ComputeError: Different timezones found during 'strptime' operation.
How do I persuade it to convert these successfully? (ideally handling different timezones as well as the change from summer to winter time)
And then how do I convert these timestamps back to the proper local clocktime for display?
Note that while the timestamp strings just show the offset, there is an exif field "Time Zone City" in the metadata as well as fields with just the local (naive) timestamp
import polars as plr
testdata=[
{'name': 'BST 11:06', 'ts': '2022:06:27 11:06:12.16+01:00'},
{'name': 'GMT 7:06', 'ts': '2022:12:27 12:06:12.16+00:00'},
]
pdf = plr.DataFrame(testdata)
pdfts = pdf.with_column(plr.col('ts').str.strptime(plr.Datetime, fmt = "%Y:%m:%d %H:%M:%S.%f%z"))
print(pdf)
print(pdfts)
It looks like I need to use tz_convert, but I cannot see how to add it to the conversion expression and what looks like the relevant docpage just 404's broken link to dt_namespace