Finding the day of a week

Started by Grincheux, June 07, 2009, 07:58:29 AM

Previous topic - Next topic

Grincheux

The function takes a date and give the date corresponding to the first day of the week.

Four examples :

If the date is 2009/1/1 the function returns 2008/12/28
If the date is 2009/6/6 the function returns 2009/5/31
If the date is 2009/6/7 the function returns 2009/6/7
If the date is 2009/6/8 the function returns 2009/6/7

This is useful for computing the difference between two weeks.

The code can be downloaded at http://phrio.biz/download/Sources/GetFirstWeekDay.asm
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz