marmaxx
asked on
Getting the Week Number for the Year Given a Date
I am trying to find a simple way to get the week number for a year, given a data in the format dd/mm/yyyy (e.g. 07/01/2006). The year will not necessarily be the curent year, it could be a past or future year. (This is what's giving me the problem).
Thanks!
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
static int weekOfYear(DateTime dt)
{
return (int)((int)(dt.DayOfYear + DateTime.ParseExact(dt.Yea
}
Week is from Sunday to Saturday.