I found a few approaches how to convert the Pandas datetime to Unix timestamp, however the results are not the same. What am I doing wrong, why the res1 = res2 = res3 != res4? (there is 3,600 second difference). Thank you!
res1 = Float64Index([1,677,628,800.0], dtype='float64')
res2 = Float64Index([1,677,628,800.0], dtype='float64')
res3 = 1,677,628,800
res4 = 1,677,625,200
From https://www.unixtimestamp.com/, the correct result should be 1677625200.
import pandas as pd
import time
# https://stackoverflow.com/questions/54313463/pandas-datetime-to-unix-timestamp-seconds
print('res1 = ' + str(pd.to_datetime(['2023-03-01 00:00:00'], utc=True).astype('int64') / 10**9))
print('res2 = ' + str((pd.to_datetime(['2023-03-01 00:00:00 00:00']) - pd.Timestamp("1970-01-01")).total_seconds()))
print('res3 = ' + str(pd.Timestamp('2023-03-01 00:00:00 00:00').timestamp()))
# https://www.geeksforgeeks.org/how-to-convert-datetime-to-unix-timestamp-in-python/
print('res4 = ' + str(time.mktime(pd.to_datetime(['2023-03-01 00:00'], utc=True)[0].timetuple())))