Suppose that you have this date:
some_date = pd.Timestamp("1970-01-01")
print(some_date)
Output: Timestamp('1970-01-01 00:00:00')
To transform it to datetime just do this:
some_date.to_pydatetime()
And you will get:
output: datetime.datetime(1970, 1, 1, 0, 0)
You can't use datetime.datetime(some_date)
because the constructor of the datetime.datetime
class takes 3 int numbers:
One for the year, one for the month and one for the day.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…