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:
commit
9bb6d75066
1 changed files with 6 additions and 3 deletions
|
@ -452,9 +452,12 @@ class PhotoAsset(object):
|
|||
|
||||
@property
|
||||
def asset_date(self):
|
||||
try:
|
||||
dt = datetime.fromtimestamp(
|
||||
self._asset_record['fields']['assetDate']['value'] / 1000.0,
|
||||
tz=pytz.utc)
|
||||
except:
|
||||
dt = datetime.fromtimestamp(0)
|
||||
return dt
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in a new issue