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. how to convert the dd/mm/yyyy string date format to mm/dd/yyyy format

how to convert the dd/mm/yyyy string date format to mm/dd/yyyy format

Scheduled Pinned Locked Moved ASP.NET
tutorial
4 Posts 4 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.
  • J Offline
    J Offline
    jagan123
    wrote on last edited by
    #1

    i am having a text box where i entered the date as 14/01/2008 now i want this string date format to convert into mm/dd/yyyy format for validation

    J E R 3 Replies Last reply
    0
    • J jagan123

      i am having a text box where i entered the date as 14/01/2008 now i want this string date format to convert into mm/dd/yyyy format for validation

      J Offline
      J Offline
      jchalfant
      wrote on last edited by
      #2

      I believe this is what you're looking for: DateTime x = DateTime.Now; x.ToString("MM/dd/yyyy")

      1 Reply Last reply
      0
      • J jagan123

        i am having a text box where i entered the date as 14/01/2008 now i want this string date format to convert into mm/dd/yyyy format for validation

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #3

        DateTime s = DateTime.ParseExact("14/01/2008", "dd/MM/yyyy", null); I believe there is also a corresponding js function as well.

        Need a C# Consultant? I'm available.
        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

        1 Reply Last reply
        0
        • J jagan123

          i am having a text box where i entered the date as 14/01/2008 now i want this string date format to convert into mm/dd/yyyy format for validation

          R Offline
          R Offline
          ram1974
          wrote on last edited by
          #4

          Hi Jagadeesh, You may use CONVERT(CHAR(10), CURRENT_TIMESTAMP/date, 101) where 101 is UK date format(dd/mm/yyyy) 103 is dd/mm/yyyy.... etc., hope this will help. -Ram.

          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