Reputation: 536
For example, I have the int 043017, which I want converted to 04/30/17 (April 30, 2017), I want to be able to convert any int of that format into datetime, how can this be accomplished?
Upvotes: 6
Views: 6354
Reputation: 2198
import datetime d = datetime.datetime.strptime(input, '%m%d%y')
Upvotes: 7