I'm trying to convert timesteps of 2 min to datetime format. I want to do it for a full day, so from 0 min to 1440 min in steps of 2 min.
My problem is that when I convert 0 seconds to datetime it outputs 01:00:00, when I want 00:00:00. Here's the code (len(df.index) = 720, it comes from a dataset I have of those 720 timesteps):
from datetime import datetime
timeline = []
for timestep in range(len(df.index)):
time = datetime.fromtimestamp(timestep*2*60).strftime("%H:%M:%S")
timeline.append(time)
print(timeline[:5])
And the output is. Any idea why?
['01:00:00', '01:02:00', '01:04:00', '01:06:00', '01:08:00']