Synopsis: |
| getdayfromdate.py |
| ||
#returns 1 to 365 def GetDayFromDate(t): import time return time.localtime(t)[7] #-- unit tests def test_getdayfromdate(): ut.utassert(GetDayFromDate(0), 365) ut.utassert(GetDayFromDate(28799), 365) ut.utassert(GetDayFromDate(28800), 1) ut.utassert(GetDayFromDate(28800 + 60*60*24*365), 1) ut.utassert(GetDayFromDate(28800 + 60*60*24*366), 2) ut.utassert(GetDayFromDate(1096523422), 273) |
| Contact me about content on this page using john_web-at-arrizza-dot-com |
| For Web Master or site problems contact: webadmin-at-arrizza-dot-com |
| Copyright John Arrizza (c) 2001-2010 |