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. General Programming
  3. C#
  4. DateTime

DateTime

Scheduled Pinned Locked Moved C#
csharpvisual-studiocomhelp
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.
  • M Offline
    M Offline
    Muhammad Waqas Butt
    wrote on last edited by
    #1

    Hi, I want to show date format in VS.Net C# default control like this Day-Month-Year Hours:Minutes AM|PM i set the control property on custom and add this text to custom format like this dd-MM-yyyy HH:mm AM/PM but is show values like this 20-05-2006 6:25 A.5/P.5. Please tell me how i solve this problem. thanks |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

    T S 2 Replies Last reply
    0
    • M Muhammad Waqas Butt

      Hi, I want to show date format in VS.Net C# default control like this Day-Month-Year Hours:Minutes AM|PM i set the control property on custom and add this text to custom format like this dd-MM-yyyy HH:mm AM/PM but is show values like this 20-05-2006 6:25 A.5/P.5. Please tell me how i solve this problem. thanks |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

      T Offline
      T Offline
      Talal Sultan
      wrote on last edited by
      #2

      Well, as far as I know, a time with the format HH:mm will give you time in 24-hour format, like 20:05 for example for 08:05 PM. It looks like the M of AM and PM is mistakenly perceived as the M of month. Try putting hh:mm and see what happens. That's all i can think of from the information you gave. Talal "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

      M 1 Reply Last reply
      0
      • M Muhammad Waqas Butt

        Hi, I want to show date format in VS.Net C# default control like this Day-Month-Year Hours:Minutes AM|PM i set the control property on custom and add this text to custom format like this dd-MM-yyyy HH:mm AM/PM but is show values like this 20-05-2006 6:25 A.5/P.5. Please tell me how i solve this problem. thanks |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.com

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        dd-MM-yyyy hh:mm tt For more info about custom date/time format strings take a look at here[^].


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        1 Reply Last reply
        0
        • T Talal Sultan

          Well, as far as I know, a time with the format HH:mm will give you time in 24-hour format, like 20:05 for example for 08:05 PM. It looks like the M of AM and PM is mistakenly perceived as the M of month. Try putting hh:mm and see what happens. That's all i can think of from the information you gave. Talal "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook

          M Offline
          M Offline
          Mohmmad Rezazadeh
          wrote on last edited by
          #4

          datetime.Tostring (a , b) ; a and b change output string to mm-dd-yy hh:mm:ss and ....

          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