Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Created July 27, 2018 15:35
Show Gist options
  • Save vinaykudari/6afc387674cbc1865692ccefee6e587e to your computer and use it in GitHub Desktop.
Save vinaykudari/6afc387674cbc1865692ccefee6e587e to your computer and use it in GitHub Desktop.
To datetime
import pandas as pd
time_format = '%Y-%m-%d %H%M%S'
date = ['2015-01-01 091234','2015-01-01 091234']
time_format_date = pd.to_datetime(date,format=time_format)
print(time_format_date)
>> DatetimeIndex(['2015-01-01 09:12:34', '2015-01-01 09:12:34'], dtype='datetime64[ns]', freq=None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment