I can get current time in milliseconds as follows:
import time
timestamp = int(time.time()*1000.0)
However, how can I get the milliseconds of the beginning of today, e.g. 09/09/2018 00:00 ?
I can get current time in milliseconds as follows:
import time
timestamp = int(time.time()*1000.0)
However, how can I get the milliseconds of the beginning of today, e.g. 09/09/2018 00:00 ?
I hope this works to get the required start of the date's time in milliseconds in Python 3
from datetime import datetime
dt_obj = datetime.strptime('09.09.2019 00:00',
'%d.%m.%Y %H:%M')
millisec = dt_obj.timestamp() * 1000
print(millisec)
Output>> 1568001600000.0
import pandas as pd
import datetime
int(pd.to_datetime(datetime.datetime.now().date()).value / 1000000)
# Outputs: 1536451200000