How to convert a human readable time with the format 20.12.2016 09:38:42,76 to Unix timestamps in milliseconds? I found a lot of similar questi
20.12.2016 09:38:42,76
For those who searches for an answer without parsing and loosing milliseconds, given dt_obj is a datetime:
dt_obj
python3 only, elegant
int(dt_obj.timestamp() * 1000)
both python2 and python3 compatible:
import time int(time.mktime(dt_obj.utctimetuple()) * 1000 + dt_obj.microsecond / 1000)