<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<br>Hi tim,<br><br>well i tried what your script but i do have an error<br>>>> import datetime<br>>>> yesterday = datetime.date.today () - datetime.timedelta (days=1)<br>>>> print yesterday.strftime ("%d%m%y")<br>SyntaxError: invalid syntax (<pyshell#2>, line 1)<br><br>when i jus check the variable i.e yesterday i do get the out put but its in a different format<br>datetime.date(2009, 10, 21)<br>it seems like the conversion that is where the error is coming form <br><br>I want it to be like 211009 <br><br>Thank you<br><div>
<p align="center"><strong><font color="#cc3366" face="Arial Black, Geneva, Arial, Sans-serif" size="4"><em>$LIM $H@DY</em></font></strong></p></div><br><br><br><br>> Date: Thu, 22 Oct 2009 11:14:46 +0100<br>> From: mail@timgolden.me.uk<br>> CC: python-list@python.org<br>> Subject: Re: Date strftime('%d%m%y') date to be of yesterday<br>> <br>> baboucarr sanneh wrote:<br>> > <br>> > Hi all<br>> > <br>> > 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<br>> > eg<br>> > <br>> > import time<br>> > strftime('%d%m%y') # something like minus a day..<br>> > Thank you..am a newbie to python<br>> <br>> <br>> <code><br>> import datetime<br>> yesterday = datetime.date.today () - datetime.timedelta (days=1)<br>> print yesterday.strftime ("%d%m%y")<br>> </code><br>> <br>> TJG<br>> -- <br>> http://mail.python.org/mailman/listinfo/python-list<br> <br /><hr />Windows Live: Keep your friends up to date <a href='http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010' target='_new'>with what you do online.</a></body>
</html>