title: Displaying a weekday name in VB
body: <p>Good morning,</p>
  
  <p>I am using a calendar form control to grab user selected dates and date ranges.  On a calendar click event I refresh my form to show the user the selected start and end dates.  </p>
  
  <p>As part of the refresh, I update a text field to show the weekday and the date:</p>
  
  <pre><code>txtStartDate.Text = WeekdayName(Weekday(startDate)) + " " + startDate
  </code></pre>
  
  <p>However the weekday I am getting is 1 day out (Tuesday shows as Monday, Monday is showing as Sunday, and Sunday is showing as Saturday.)</p>
  
  <p>To get around this I did the following:</p>
  
  <pre><code>txtStartDate.Text = WeekdayName(Weekday(startDate) - 1) + " " + startDate
  </code></pre>
  
  <p>This worked for Monday - Saturday, but when I select a Sunday on the calendar, it (obvious in hindsight!) crashes as it cannot display a date with value -1!</p>
  
  <p>I have tried in vain to find a way to set the first day of the week as Monday instead of Sunday.  I have done this to the calendar control but this only changes the displayed start day, not the value of the day.  I have tried changing the CurrentCulture settings:</p>
  
  <pre><code>Thread.CurrentThread.CurrentCulture = New CultureInfo("en-UK")
  Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-UK") 
  </code></pre>
  
  <p>This doesn't work either.</p>
  
  <p>How can I set Monday as being day 0 in Weekday(startDate)?</p>