Probably fixed tz time offset bug, needs proper testing though.

This commit is contained in:
Marcus Scholz 2020-12-27 04:04:53 +01:00
parent 59a829c428
commit 3642d64505
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class Radiation:
def _time_conversion(self, timestamp, local_timezone):
csv_naive_time = datetime.fromisoformat(timestamp)
# Set timezone
csv_aware_time = csv_naive_time.astimezone(local_timezone)
csv_aware_time = csv_naive_time.localize(local_timezone)
return csv_aware_time
def _radiation_conversion(self, radiation, si_factor):
@ -102,7 +102,7 @@ class Photo:
# date.value creates datetime object in pic_naive_time
pic_naive_time = date.value
# Set timezone
pic_aware_time = pic_naive_time.astimezone(local_timezone)
pic_aware_time = pic_naive_time.localize(local_timezone)
return pic_aware_time
class Match:

View File

@ -112,7 +112,7 @@ if args.gpx:
for track in gpx_reader.tracks:
for segment in track.segments:
for point in segment.points:
point_aware_time = point.time.astimezone(local_timezone)
point_aware_time = point.time.localize(local_timezone)
position = (
point_aware_time,
point.latitude,