Skip to content Skip to sidebar Skip to footer

How To Convert Multiple Date Formats In One Format In Pandas

I have following pandas dataframe with date column as object ID Date Volume 0 13-02-2018 00:06 85 1 13-02-2018 00:10 70 2

Solution 1:

try this:

df['Date'] = pd.to_datetime(df.Date)

df['Date'] = df['Date'].dt.strftime('%Y-%m-%d %H:%M')

link: Series.dt.strftime

Solution 2:

Import time

Localtime= time.asctime(time.localtime(time.time()))
Print(localtime)

Check if this we work

Post a Comment for "How To Convert Multiple Date Formats In One Format In Pandas"