Skip to content

Instantly share code, notes, and snippets.

@blaylockbk
Last active May 29, 2021 10:29
Show Gist options
  • Save blaylockbk/1654c4616bd294a0fd9bc1e2ce416766 to your computer and use it in GitHub Desktop.
Save blaylockbk/1654c4616bd294a0fd9bc1e2ce416766 to your computer and use it in GitHub Desktop.
from datetime import datetime
dates = ['01/01/2016 04:50','01/01/2016 05:50','01/01/2016 06:50','01/01/2016 07:50']
DATE = [datetime.strptime(x,'%m/%d/%Y %H:%M') for x in dates]
@mmatjintje
Copy link

did you use imports here?

@blaylockbk
Copy link
Author

yes, from datetime import datetime. I updated the gist.

@Cal-web
Copy link

Cal-web commented May 29, 2021

this one works well, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment