2 Aug
2000
2 Aug
'00
12:57 p.m.
Arjan Scherpenisse <acscherp@wins.uva.nl> wrote:
i want to retrieve the number of the week from a DateTime object. Is there any way to do this? I've looked through DateTime.py but i couldnt find anything usefull, is there some algorithm to get this?
You can clean it up and condense but the following should work ... <dtml-let today="_.DateTime()"> <dtml-let cur_year="today.year()"> <dtml-let start_of_year="_.DateTime('01/01/'+_.str(cur_year))"> <dtml-let num_days="today-start_of_year"> <dtml-let week_number="_.int(num_days/7)"> <dtml-var week_number> </dtml-let> </dtml-let> </dtml-let> </dtml-let> </dtml-let> Cheers, Darran.
9377
Age (days ago)
9377
Last active (days ago)
0 comments
1 participants
participants (1)
-
Darran Edmundson