Fixed bug in date() if imageTimeZoneOffsetSeconds was None
This commit is contained in:
@@ -980,7 +980,8 @@ class PhotoInfo:
|
|||||||
def date(self):
|
def date(self):
|
||||||
""" image creation date as timezone aware datetime object """
|
""" image creation date as timezone aware datetime object """
|
||||||
imagedate = self.__info["imageDate"]
|
imagedate = self.__info["imageDate"]
|
||||||
delta = timedelta(seconds=self.__info["imageTimeZoneOffsetSeconds"])
|
seconds = self.__info["imageTimeZoneOffsetSeconds"] or 0
|
||||||
|
delta = timedelta(seconds=seconds)
|
||||||
tz = timezone(delta)
|
tz = timezone(delta)
|
||||||
imagedate_utc = imagedate.astimezone(tz=tz)
|
imagedate_utc = imagedate.astimezone(tz=tz)
|
||||||
return imagedate_utc
|
return imagedate_utc
|
||||||
|
|||||||
Reference in New Issue
Block a user