Re: current week / weeks in year - best practice



On Jul 31, 3:58 pm, "Diez B. Roggisch" <de...@xxxxxxxxxxxxx> 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
.



Relevant Pages

  • Re: current week / weeks in year - best practice
    ... what if i know current context week = 20, ... best way to get datetime objects for first and last day of current ... Tim Roberts, timr@xxxxxxxxx ... Providenza & Boekelheide, Inc. ...
    (comp.lang.python)
  • find nearest time in datetime list
    ... I have a list of datetime objects: DTlist, I have another single datetime ... I need to find the nearest DTlistto the dt ... View this message in context: http://www.nabble.com/find-nearest-time-in-datetime-list-tp15180398p15180398.html ...
    (comp.lang.python)