Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. 12-Apr-2016 23:59:59.720321
  2.  
  3. def timestampthen(timestring):
  4. tt = datetime.datetime.strptime(timestring, "%d-%b-%Y %H:%M:%S.%f").timetuple()
  5. ut = float(calendar.timegm(tt))
  6. dotpos = timestring.rfind(".")
  7. frac = float(timestring[dotpos:])
  8. utfloat = float(ut + frac)
  9. return utfloat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement