Date strftime('%d%m%y') date to be of yesterday

Tim Golden mail at
Thu Oct 22 12:14:46 CEST 2009

baboucarr sanneh wrote:
> Hi all
> I want to output the date of the with this format strftime('%d%m%y') but the date ie '%d' should be the date of yesterday
> eg
> import time
> strftime('%d%m%y') # something like minus a day..
> Thank a newbie to python

import datetime
yesterday = () - datetime.timedelta (days=1)
print yesterday.strftime ("%d%m%y")


More information about the Python-list mailing list