Thursday 14 July 2016

Python: Calendar: timegm: get UNIX time stamp value

calendar.timegm(tuple)
‘timegm’ method takes time tuple and returns corresponding UNIX timestamp value.
>>> import calendar
>>> import time
>>> 
>>> print(calendar.timegm(time.gmtime()))
1447053189


Previous                                                 Next                                                 Home

No comments:

Post a Comment