Skip to content

Commit

Permalink
Calculate UTC time based on UTC offset in iso8601 timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Frederiks committed Oct 10, 2017
1 parent 1e7fe23 commit ff52dff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion moai/yoda.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ def update(self, path):
log.warning("Missing Last Modified Time in %s".format(path))
self.modified = datetime.now() - timedelta(days=1)
else:
self.modified = datetime.strptime(last_modified, "%Y-%M-%d")
ret = datetime.strptime(last_modified[0:19],'%Y-%m-%dT%H:%M:%S')
if last_modified[19]=='+':
ret-=timedelta(hours=int(last_modified[20:22]),minutes=int(last_modified[22:]))
elif last_modified[19]=='-':
ret+=timedelta(hours=int(last_modified[20:22]),minutes=int(last_modified[22:]))
self.modified = ret

author_data = []
creators = xpath.strings('//Creator/Name')
Expand Down

0 comments on commit ff52dff

Please sign in to comment.