Why does strptime from datetime not give me the correct hours?
问题 I am dealing with hourly data in which the date is stored in 4 different arrays, one for day, month, year, and hour. I am running a for-loop to rather store these dates as strings with this format: '01/01/1946 0' My code looks something like this: import numpy as np from datetime import datetime as dt import matplotlib.dates as mdates for nn in range(nnn): y1 = int(yr[nn]) m1 = int(mon[nn]) d1 = int(day[nn]) h1 = int(hr[nn]) #In the the last string we are specifying the format datenow = dt