How to print in DD-MM-YYYY


Let’s say today is 6th Feb 2018.
I want to print 06/02/2018

from datetime import datetime
now =

print ‘%s/%s/%s’ %(, now.month, now.year)


How can I get 06/02/2018 ?


strftime is what you are looking for:

if you want to display a data in specific way.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.