Re: current week / weeks in year - best practice

2008-08-03 Thread egbert
On Sat, Aug 02, 2008 at 07:46:49PM -0700, Dennis Lee Bieber wrote: > > What is the meaning of ? e. -- Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991 -- http://mail.python.org/mailman/listinf

Re: current week / weeks in year - best practice

2008-08-02 Thread Tim Roberts
Aljosa Mohorovic <[EMAIL PROTECTED]> 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 progra

Re: current week / weeks in year - best practice

2008-07-31 Thread Aljosa Mohorovic
On Jul 31, 5:42 pm, Aljosa Mohorovic <[EMAIL PROTECTED]> 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 c

Re: current week / weeks in year - best practice

2008-07-31 Thread Aljosa Mohorovic
On Jul 31, 3:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> 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

Re: current week / weeks in year - best practice

2008-07-31 Thread Diez B. Roggisch
Aljosa Mohorovic wrote: > i use this to find out current week and total number of weeks for > current year: > now = datetime.now() > weeks_in_year = int(date(now.year, 12, 31).strftime("%W")) > current_week = int(date(now.year, now.month, now.day).strftime("%W")) > > is this the best way or is th

current week / weeks in year - best practice

2008-07-31 Thread Aljosa Mohorovic
i use this to find out current week and total number of weeks for current year: now = datetime.now() weeks_in_year = int(date(now.year, 12, 31).strftime("%W")) current_week = int(date(now.year, now.month, now.day).strftime("%W")) is this the best way or is there a better way? Aljosa Mohorovic --