1from datetime import datetime
2
3print(datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
1from datetime import datetime
2
3dt_obj = datetime.strptime('20.12.2016 09:38:42,76',
4 '%d.%m.%Y %H:%M:%S,%f')
5millisec = dt_obj.timestamp() * 1000
6
7print(millisec)