diff --git a/elodie/filesystem.py b/elodie/filesystem.py index 8a71ab5f..314d255c 100644 --- a/elodie/filesystem.py +++ b/elodie/filesystem.py @@ -10,6 +10,7 @@ import re import shutil import time +import calendar from elodie import compatability from elodie import geolocation @@ -628,5 +629,5 @@ def set_utime_from_metadata(self, metadata, file_path): else: # We don't make any assumptions about time zones and # assume local time zone. - date_taken_in_seconds = time.mktime(date_taken) + date_taken_in_seconds = calendar.timegm(date_taken) os.utime(file_path, (time.time(), (date_taken_in_seconds))) diff --git a/elodie/media/photo.py b/elodie/media/photo.py index b070877b..cee4f217 100644 --- a/elodie/media/photo.py +++ b/elodie/media/photo.py @@ -60,7 +60,7 @@ def get_date_taken(self): exif = self.get_exiftool_attributes() if not exif: - return seconds_since_epoch + return time.gmtime(seconds_since_epoch) # We need to parse a string from EXIF into a timestamp. # EXIF DateTimeOriginal and EXIF DateTime are both stored