Convert python datetime to timestamp in milliseconds
问题 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 questions, but didn't found this specific question/answer. 回答1: In Python 3 this can be done in 2 steps: Convert timestring to datetime object Multiply the timestamp of the datetime object by 1000 to convert it to milliseconds. For example like this: from datetime import datetime dt_obj = datetime.strptime('20.12.2016 09:38:42,76', '%d.%m.%Y %H:%M:%S,%f')