This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime, time | |
def convert_enddate_to_seconds(self, ts): | |
"""Takes ISO 8601 format(string) and converts into epoch time.""" | |
dt = datetime.datetime.strptime(ts[:-7],'%Y-%m-%dT%H:%M:%S.%f')+\ | |
datetime.timedelta(hours=int(ts[-5:-3]), | |
minutes=int(ts[-2:]))*int(ts[-6:-5]+'1') | |
seconds = time.mktime(dt.timetuple()) + dt.microsecond/1000000.0 | |
return seconds |
NewerOlder