Skip to content

Instantly share code, notes, and snippets.

@DazWorrall
Created June 24, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DazWorrall/bbbc0cc2e6c3cad19660 to your computer and use it in GitHub Desktop.
Save DazWorrall/bbbc0cc2e6c3cad19660 to your computer and use it in GitHub Desktop.
py.ouy
$ python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> last_christmas = datetime(2014,12,25)
>>> next_christmas = datetime(2015,12,25)
>>> today = datetime.today()
>>> (today - last_christmas).days
181
>>> (next_christmas - today).days
183
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment