Skip to content

Commit

Permalink
Merge pull request #18 from carlosprados/master
Browse files Browse the repository at this point in the history
Bug fix in to_unix conversion
  • Loading branch information
akalongman authored Jun 23, 2016
2 parents 17ede15 + 4b59fa4 commit e9c92a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stringutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def from_unix(self, timestamp):
def to_unix(self, timestr):
sublime.status_message('Convert from human readable date to epoch.')
try:
return '%d' % (time.mktime(timestr.timetuple()))
datetime_to_convert = datetime.strptime(timestr, "%Y-%m-%d %H:%M")
return '%d' % (time.mktime(datetime_to_convert.timetuple()))
except:
return False

Expand Down

0 comments on commit e9c92a0

Please sign in to comment.