<div dir="ltr">I want to keep a collection of data organized by collection date and I'll use datetime like this...<div><br></div><div><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
>>> datetime.date.today()<u></u><u></u></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">datetime.date(2014, 3, 26)</p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">I'll format the date and create directories like /mydata/yyyy-mm-dd</span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">When I create a directory for today, I need to know the directory name for yesterday and tomorrow. In perl I could get seconds since the epoch using time and then add or subtract from that number for tomorrow or yesterday and feed that into localtime to get the date string.</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">It would be convenient if  datetime.date.today() accepted an argument as an offset from today, like datetime.date.today(-1). Is there an easy way to do this with datetime?</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><div><br>
</div><div><br></div></div></div>