DateTimeFormatInfo.FirstDayOfWeek Property

Results 1 to 2 of 2

Thread: DateTimeFormatInfo.FirstDayOfWeek Property

  1. #1
    Join Date
    Dec 1969

    Default DateTimeFormatInfo.FirstDayOfWeek Property

    When trying to get the Week of the Year I would normally create a small function like:<BR>private int WeekOfYear()<BR>{<BR> int i = DateTime.Now.DayOfYear;<BR> if(i%7==0)<BR> {<BR> return i/7;<BR> }<BR> else<BR> {<BR> return (i/7) + 1;<BR> }<BR>}<BR>Label1.Text = "The week of the year is : " + WeekOfYear().ToString());<BR><BR>Yes this can work but I think .NET has created a CalendarWeekRule Enumeration which works much better than simply using 365/7. Im having some problems finding documentation finding quality documentation or sample code which can help describe how to use this. <BR><BR>Any help offered is greatly appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: DateTimeFormatInfo.FirstDayOfWeek Property

    Check this link out, it may have what your looking for:<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts