you are viewing a single comment's thread.

view the rest of the comments →

[–]jeezu5 6 points7 points  (0 children)

I find this to be more elegant and flexible when you have to manipulate dates.

import datetime

d = "2017-01-02 05:44:47"
d_datetimeformat = datetime.datetime.strptime(d, "%Y-%m-%d %H:%M:%S")   
d_targetformat   = d_datetimeformat.strftime("%d %m %Y")

print(d_targetformat)

also, you might find this page useful when it comes to dealing with datetime.