Python dates
Jump to navigation
Jump to search
Python dates are a notorious pain in the ass. Here's a short field guide.
Object types
When using pd.to_datetime with a text date (e.g., '2022-05-19'), the result is a *timestamp* object.
<syntaxhighlight, lang=Python>
df['Date'].iloc[0]
Timestamp('2022-05-19 00:00:00')
</syntaxhighlight>