convert system date in dd/MMM/yyyy format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neoupadhyay
    New Member
    • Feb 2007
    • 57

    convert system date in dd/MMM/yyyy format

    Hi Friends,

    I am Using ASP.NET1.1 and i want to convert the system date, in dd/MMM/yyyy format.

    Earlier i use
    lblDate.Text = System.DateTime .Now.AddMinutes (30).ToString() ;

    But i want to convert this format to dd/MMM/yyyy, can anybody provide me some help or what can i do please suggest me...


    Thnx
  • krille
    New Member
    • Feb 2008
    • 26

    #2
    Hmmm dont really get what you want to do so im guessing you want something like this:

    lblDate.Text = System.DateTime .Now.AddMinutes (30).ToString(" dd/MMM/yyyy ");


    Just add "dd/MMM/yyyy" int the ToString to get the wanted format

    GL
    Krille

    Comment

    • neoupadhyay
      New Member
      • Feb 2007
      • 57

      #3
      Originally posted by krille
      Hmmm dont really get what you want to do so im guessing you want something like this:

      lblDate.Text = System.DateTime .Now.AddMinutes (30).ToString(" dd/MMM/yyyy ");


      Just add "dd/MMM/yyyy" int the ToString to get the wanted format

      GL
      Krille

      Yes sir,

      But i got error

      The name 'dd' does not exist in the class or namespace 'test.UserContr ols.IndexHeader '

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Originally posted by neoupadhyay
        Hi Friends,

        I am Using ASP.NET1.1 and i want to convert the system date, in dd/MMM/yyyy format.

        Earlier i use
        lblDate.Text = System.DateTime .Now.AddMinutes (30).ToString() ;

        But i want to convert this format to dd/MMM/yyyy, can anybody provide me some help or what can i do please suggest me...

        Thnx
        The format should be dd/MM/yyyy. Rather than convert methods I usually ensure that it is going to be consistent by setting the culture in the web.config. HTH.

        Comment

        Working...