Advertisement
silasvasconcelos

Convert time in Python

Dec 17th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. import time
  2. timestamp = "2016-12-17T15:40:32.000Z"
  3. ts = time.strptime(timestamp[:19], "%Y-%m-%dT%H:%M:%S")
  4. print time.strftime("%Y-%m-%d %H:%M:%S", ts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement