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 & Time in ASP.net

Date & Time in ASP.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
6 Posts 5 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.
  • B Offline
    B Offline
    bsshowriraju0001
    wrote on last edited by
    #1

    guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

    L J A K 5 Replies Last reply
    0
    • B bsshowriraju0001

      guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Did you try DateTime.Parse? DateTime.TryParse? DateTime.ParseExact? http://msdn.microsoft.com/en-us/library/497a406b.aspx[^]

      Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012

      1 Reply Last reply
      0
      • B bsshowriraju0001

        guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

        J Offline
        J Offline
        jkirkerx
        wrote on last edited by
        #3

        I think you want DateTime.Now.ToString(mm-dd-yyyy)

        DateTime.Now.ToString("mm-dd-yyyy")

        You'll have to adjust the string for the proper format needed

        1 Reply Last reply
        0
        • B bsshowriraju0001

          guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

          A Offline
          A Offline
          Aysha Patel
          wrote on last edited by
          #4

          Try the following code. DateTime fdate = Convert.ToDateTime(txtstartdate.text.ToString()); string ST = ""; ST = String.Format("{0:MM/dd/yyyy}", fdate); :) :) :) :thumbsup:

          1 Reply Last reply
          0
          • B bsshowriraju0001

            guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

            K Offline
            K Offline
            KiranKumar Roy
            wrote on last edited by
            #5

            try this one..

            protected string FormatDate()
            {
            string strTemp;
            strTemp = DateTime.Now.ToString("dd/MM/yyyy");
            return strTemp;
            }

            KiranKumar Roy

            1 Reply Last reply
            0
            • B bsshowriraju0001

              guys please tell me how convert sys date 04-10-2012 to dd-MM-yyyy and who to get system datetime format

              K Offline
              K Offline
              KiranKumar Roy
              wrote on last edited by
              #6

              try this one..

              protected string FormatDate()
              {
              string strDate;
              strDate = DateTime.Now.ToString("dd/MM/yyyy");
              return strDate;
              }

              KiranKumar Roy

              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