I have the following string:
27/02/2019
As it is known in the program that those dates correspond to NY time zone, I would like to get the timestamp corresponding to:
27/02/2019 00:00 US/Eastern
I have tried:
import datetime
import pytz
exchange_tz = pytz.timezone('US/Eastern')
_period1 = datetime.datetime(2019,2,27)
_period1_localized = exchange_tz.localize(_period1)
_period1_ts = int((_period1_localized - datetime.datetime(1970, 1, 1, tzinfo=exchange_tz)).total_seconds())
>>> _period1_ts
1551225600
But this gives the timestamp corresponding to:
27/02/2019 00:00 UTC
I have checked that 1551225600
timestamp corresponds to 27/02/2019 00:00 UTC
and not to 27/02/2019 00:00 US/Eastern
using this service:
https://www.epochconverter.com/
What am I doing wrong?