Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

VB.Net: What day of the week is a certain date

From Wiki

Jump to: navigation, search

This little code shows some ways to get the day of the week. Either as a number or as a word.

In my case it shows four because in belgium we start the week on monday. For some of you it will be three. The word is in dutch but this also depends on your local settings. Don't forget you can always set and reset the localsetting at runtime.

  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Dim _Date As New Date(2008, 7, 10)
  5.         Console.WriteLine("begin")
  6.         Console.WriteLine(_Date.ToString("dd/MM/yyyy"))
  7.         Console.WriteLine(_Date.DayOfWeek())
  8.         Console.WriteLine(_Date.ToString("dddd"))
  9.         Console.ReadLine()
  10.     End Sub
  11.  
  12. End Module

this is the result.

Image:Dayofweek.jpg

547 Rating: 1.3/5 (4 votes cast)