Need some tips on programming to find "week of the year"

rml

Lifer
Jul 6, 2000
15,836
0
0
I need to find out what week of the year when someone give me a particular date

For example: January 13,2003 is in the 3rd week of 2003



Any idea? Any existing program/logic out there?

thanks in advance
 

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
What language, if you are using PHP you can just use the date function $week = date("W"); perl has something simmilar that I know off too. I think it is "$week = strftime "%W", localtime;"
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
strftime is a pretty standard function, it was in C long before anything else. It's in python and perl and probably many others.