Calculating 80 days from now

  |   Source

Checking when 80 days from the start of the project is

The first commit to github was done on 15th November 2014.

However, I had been working on the project for a couple of days by then, so I will take 13th November 2014 as the start date.

In [1]:
import datetime
In [2]:
start = datetime.date(2014, 11, 13)

start.isoformat()
Out[2]:
'2014-11-13'

Now calculate 80 days from the start date

In [3]:
end = start + datetime.timedelta(days=80)

Check that the 80 days of coding ends on 1st February 2015

In [4]:
end.isoformat()
Out[4]:
'2015-02-01'

What day of the week does the competition start on?

In [5]:
end.strftime("%A")
Out[5]:
'Sunday'

How many days are we into the project?

In [6]:
today = datetime.date.today()

day = (today-start).days

print("Today is day %(day)d.  %(togo)d days to go." % dict(day=day, togo=(80-day)))
Today is day 70.  10 days to go.
Comments powered by Disqus