Merge pull request #184 from ndbroadbent/year_is_out_of_range

Fix 'ValueError: year is out of range' when year is set to 0000
This commit is contained in:
Adam Coddington 2018-12-12 19:08:01 -08:00 committed by GitHub
commit 9bb6d75066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,9 +452,12 @@ class PhotoAsset(object):
@property @property
def asset_date(self): def asset_date(self):
try:
dt = datetime.fromtimestamp( dt = datetime.fromtimestamp(
self._asset_record['fields']['assetDate']['value'] / 1000.0, self._asset_record['fields']['assetDate']['value'] / 1000.0,
tz=pytz.utc) tz=pytz.utc)
except:
dt = datetime.fromtimestamp(0)
return dt return dt
@property @property