current week / weeks in year - best practice
- From: Aljosa Mohorovic <aljosa.mohorovic@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 06:36:08 -0700 (PDT)
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
.
- Follow-Ups:
- Re: current week / weeks in year - best practice
- From: Diez B. Roggisch
- Re: current week / weeks in year - best practice
- Prev by Date: Re: Difference between type and class
- Next by Date: problem when reading file
- Previous by thread: How smart is the Python interpreter?
- Next by thread: Re: current week / weeks in year - best practice
- Index(es):