>>>Anyone got a function that will take a date and return the week of the year >>>it resides in? >>> >>>Mel Patrick >>>mel@... >> >>Try the following code, it uses the DateTimeRec structure. If you know the >>date, then it figures out several things for you, including the day of the >>week. Neat: > >[code snip] > >Thanks for the routines tedd, what I was looking for was a conversion to >take a date and then return the number of the week (1-52) of the year in >which that date is. > >Time to put on my thinking cap...;-) (now where did I leave it) > >Mel Patrick Mel: Well duh! I guess that I could have _read_ your email instead of guessing at it. You wanted day of the year, not day of the week. The problem you face is in figuring the number of the week with consideration to leap years. I think that the routines I gave you do that. Now, the problem is how does one figure out what week using those routines? Well... these routines will figure the difference between any two dates in seconds. So, I would use the routines to determine the difference (in seconds) between Jan 1 of x year and your date of x year. From there, the number of weeks would be a standard amount of seconds (a range) between each week. tedd ___________________________________________________________________ <mailto:tedd@...> http://sperling.com/