Reputation: 119
Good morning, everyone, are there any Python functions to get Year, Month, Day, Weekday, Hour information from the following time?
1/21/2015 01:30:22 AM
Thank you very much. Dennis
Upvotes: 0
Views: 37
Reputation: 4482
According to the strftime documentation:
from datetime import datetime
mydate = '1/21/2015 01:30:22 AM'
print datetime.strptime(mydate, '%m/%d/%Y %I:%M:%S %p')
Upvotes: 1