Re: current week / weeks in year - best practice
- From: Aljosa Mohorovic <aljosa.mohorovic@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 09:11:48 -0700 (PDT)
On Jul 31, 5:42 pm, Aljosa Mohorovic <aljosa.mohoro...@xxxxxxxxx>
wrote:
what if i know current context week = 20 (example), what would be the
best way to get datetime objects for first and last day of current
context week?
by "current context week" i don't mean current week for current year
but current week when program is iterating all weeks in year.
if w = current context week and now is current datetime object this
is how i calculate days:
first_day = datetime.strptime("%s %s" % (now.year, str((w-1)*7)), "%Y
%j")
last_day = first_day + timedelta(days=6)
any comments on this?
Aljosa Mohorovic
.
- References:
- current week / weeks in year - best practice
- From: Aljosa Mohorovic
- Re: current week / weeks in year - best practice
- From: Diez B. Roggisch
- Re: current week / weeks in year - best practice
- From: Aljosa Mohorovic
- current week / weeks in year - best practice
- Prev by Date: Re: Newbie Python questions
- Next by Date: Re: How smart is the Python interpreter?
- Previous by thread: Re: current week / weeks in year - best practice
- Next by thread: problem when reading file
- Index(es):