Results 1 to 4 of 4

Thread: vb.net date dayofweek

  1. #1
    Join Date
    Apr 2009
    Posts
    21

    vb.net date dayofweek

    I am using VB.net & need to get the date of the two specific days of a week. I don't find any way to find that better then the DateTime.Now by looping incrementing/decrementing by day unless you reach the Day of the week

    Does anyone know the better option??? Please Help.....!

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: vb.net date dayofweek

    The. NET Framework makes it easy to order assigned day of the week for a certain date, and the localized weekday name for a certain date to show. The listed value on the day of the week points to a certain date answers are available from the possession or dayofweek. In contrast, the recovery of the weekday name of a formatting operation that can be executed by a formatting method, such as date and time value creation; ToString method or the method String.Format.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: vb.net date dayofweek

    Syntax :

    Code:
    DayOfWeek variable = DateTime.Now.DayOfWeek;
    string d1 = DateTime.Now.DayOfWeek.ToString();

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: vb.net date dayofweek

    See the code Below Hope this is Helpful......!

    Code:
    Module Module1
    
        Sub Main()
            Dim DayOfWeek As Integer
            DayOfWeek = Now.DayOfWeek
    
            Select Case DayOfWeek
                Case 1
                    Console.WriteLine("Sunday")
                Case 2
                    Console.WriteLine("Monday")
                Case 3
                    Console.WriteLine("Tuesday")
                Case 4
                    Console.WriteLine("Wednesday")
                Case 5
                    Console.WriteLine("Thursday")
                Case 6
                    Console.WriteLine("Friday")
                Case 7
                    Console.WriteLine("Saturday")
            End Select
        End Sub
    
    End Module

Similar Threads

  1. Replies: 2
    Last Post: 29-11-2011, 09:29 AM
  2. Baseline Column Date automatically updates Finish Date
    By Adam 1980 in forum Microsoft Project
    Replies: 3
    Last Post: 18-05-2011, 06:08 PM
  3. Using date format in JSP
    By KAMANA in forum Software Development
    Replies: 6
    Last Post: 29-07-2010, 10:32 AM
  4. USB 3.0 release date
    By Dhiresh in forum Portable Devices
    Replies: 3
    Last Post: 19-08-2009, 09:32 PM
  5. Changing start date and creating formula for finish date
    By stringse in forum Microsoft Project
    Replies: 1
    Last Post: 11-09-2006, 01:13 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,729,393.52604 seconds with 16 queries