Skip to content

Commit

Permalink
Merge pull request #184 from ndbroadbent/year_is_out_of_range
Browse files Browse the repository at this point in the history
Fix 'ValueError: year is out of range' when year is set to 0000
  • Loading branch information
coddingtonbear authored Dec 13, 2018
2 parents c63e63b + fa64441 commit 9bb6d75
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyicloud/services/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,12 @@ def created(self):

@property
def asset_date(self):
dt = datetime.fromtimestamp(
self._asset_record['fields']['assetDate']['value'] / 1000.0,
tz=pytz.utc)
try:
dt = datetime.fromtimestamp(
self._asset_record['fields']['assetDate']['value'] / 1000.0,
tz=pytz.utc)
except:
dt = datetime.fromtimestamp(0)
return dt

@property
Expand Down

0 comments on commit 9bb6d75

Please sign in to comment.