1. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Dec 2005
    Rep Power

    Local Date in VB.NET


    What is the best way, please, of generating the current, local ordinal date (without the time) on an aspx page? At the moment, I have:

    Public Function ToString
    Dim dateOnly As Date
     Console.WriteLine(dateOnly.ToString("MMMM dd, yyyy") + ".")
    Dim suffix, local
    local = DateAdd( "h", 8, Now() )
    Select Case Day(local)
        Case 1,21,31: suffix = "st"
        Case 2,22: suffix = "nd"
        Case 3,23: suffix = "rd"
        Case Else: suffix = "th"
    End Select
    End Function
    I know that is incorrect, but possibly on the right lines?

    Thanks for any help.

  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Aug 2008
    Rep Power

    If i'm correct with your requirement , we have DateTime.ToLocalTime Method in C# you may use that.

    DateTime.ToLocalTime Method (System)
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

    Jquery Shake Effect ,
    Andriod KitKat

    Thank You,

Similar Threads

  1. Knowing if a local user belongs to a specific local group
    By balubeto in forum Windows Scripting
    Replies: 1
    Last Post: September 15th, 2010, 12:20 AM
  2. System Date from Server or Local PC
    By ryanlcs in forum ASP Development
    Replies: 1
    Last Post: February 28th, 2007, 09:50 PM
  3. Local date with time
    By ceema in forum HTML, JavaScript And CSS Help
    Replies: 6
    Last Post: February 12th, 2007, 10:28 AM
  4. Formating local date problem,
    By UniLeo in forum Microsoft Access Help
    Replies: 1
    Last Post: December 1st, 2004, 07:42 AM
  5. How to show local time and date
    By szms in forum HTML, JavaScript And CSS Help
    Replies: 2
    Last Post: August 3rd, 2004, 02:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo