current week / weeks in year - best practice

Aljosa Mohorovic aljosa.mohorovic at gmail.com
Thu Jul 31 11:42:46 EDT 2008


On Jul 31, 3:58 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Instead of datetime.now() use date.today(), which removes a lot of
> boilerplate.
>
> int(date.today().strftime("%W"))
>
> Apart from that, I think it's the way to go.

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.

Aljosa



More information about the Python-list mailing list