Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Date

Date

Scheduled Pinned Locked Moved ASP.NET
csharphelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A kamath
    wrote on last edited by
    #1

    I wanted to display todays date in dd-mmm-yy fromat. can anybody help me please.(Asp/c#) Ak

    H V 2 Replies Last reply
    0
    • A A kamath

      I wanted to display todays date in dd-mmm-yy fromat. can anybody help me please.(Asp/c#) Ak

      H Offline
      H Offline
      Harini N K
      wrote on last edited by
      #2

      Hi Here is an example for displaying date in any format:

      DateTime DtmDate = DateTime.Now;

      System.Globalization.DateTimeFormatInfo dfi = new System.Globalization.DateTimeFormatInfo();

      dfi.ShortDatePattern = "dd-MMM-yyyy";
      LabelDate.Text = DtmDate.ToString("d", dfi);

      Note the difference : In ShortDatePattern, you can give any format. "mm" gives month in number and "MMM" gives month as short form of month (ie. three characters) :)

      Rate this message. Thank you. Harini :)

      A 1 Reply Last reply
      0
      • H Harini N K

        Hi Here is an example for displaying date in any format:

        DateTime DtmDate = DateTime.Now;

        System.Globalization.DateTimeFormatInfo dfi = new System.Globalization.DateTimeFormatInfo();

        dfi.ShortDatePattern = "dd-MMM-yyyy";
        LabelDate.Text = DtmDate.ToString("d", dfi);

        Note the difference : In ShortDatePattern, you can give any format. "mm" gives month in number and "MMM" gives month as short form of month (ie. three characters) :)

        Rate this message. Thank you. Harini :)

        A Offline
        A Offline
        A kamath
        wrote on last edited by
        #3

        Thanks

        1 Reply Last reply
        0
        • A A kamath

          I wanted to display todays date in dd-mmm-yy fromat. can anybody help me please.(Asp/c#) Ak

          V Offline
          V Offline
          Venkatesh Mookkan
          wrote on last edited by
          #4

          You can also get today's date by Now.ToString("dd-MMM-yy")

          Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups