'Why different answers for the same logic in datetime conversion? [duplicate]
The output of converted date is '20210514'
input_date = '14-05-2021' # 14th May 2021
converted_date = (pd.to_datetime(input_date).strftime('%Y%m%d'))
But if I use the same logic below, why is it coming up like '20220601' (1st June 2022)? The output I expect is '20220106'.
input_date = '06-01-2022' # 6th Jan 2022
converted_date = (pd.to_datetime(input_date).strftime('%Y%m%d'))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
