datetime

V

Victor Engle

I want to keep a collection of data organized by collection date and I'll
use datetime like this...

datetime.date(2014, 3, 26)


I'll format the date and create directories like /mydata/yyyy-mm-dd


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.


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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top