#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    44
    Rep Power
    11

    date format 'dd-Mon-yyyy'???


    Hi

    How can i get the form to return the current date value into this format 'dd-Mon-yyyy' to a textbox??

    I try do this but i didnt get the correct month value that i need.

    txtDate.Text = Format(Now, "dd-Mon-yyyy")

    It will give me this date value instead -> 29-7on-2004.

    Can anyone show me the correct way to format a date value? Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Location
    Hong Kong
    Posts
    99
    Rep Power
    11
    dd-Mon-yyyy is incorrect
    dd-MMM-yyyy is correct
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    Code:
    DateTime dt = DateTime.Parse("3/9/2008");
    string str = dt.ToString("dd-MMM-yyyy") //09-Mar-2008

IMN logo majestic logo threadwatch logo seochat tools logo