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 / C++ / MFC
  4. DateTimeControl date format

DateTimeControl date format

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • L Offline
    L Offline
    Lodeclaw
    wrote on last edited by
    #1

    Hi there. I'm trying to set the format of my DateTimeControls to yyyy/mm/dd but the only method I can find is through the localeid property. The only locales that use yyyy/mm/dd as their primary format are non-english, so they don't help me much. The government standard in Canada (where I am) is yyyy/mm/dd but as a nation all three primary formats are used. Is there any way to select which format I want to use, or am I stuck with Microsoft's default, dd/mm/yyyy? Thanks ahead of time for any assistance!

    D 2 Replies Last reply
    0
    • L Lodeclaw

      Hi there. I'm trying to set the format of my DateTimeControls to yyyy/mm/dd but the only method I can find is through the localeid property. The only locales that use yyyy/mm/dd as their primary format are non-english, so they don't help me much. The government standard in Canada (where I am) is yyyy/mm/dd but as a nation all three primary formats are used. Is there any way to select which format I want to use, or am I stuck with Microsoft's default, dd/mm/yyyy? Thanks ahead of time for any assistance!

      D Offline
      D Offline
      daveyerwin
      wrote on last edited by
      #2

      Maybe you need CDateTimeCtrl::SetFormat().

      L 1 Reply Last reply
      0
      • D daveyerwin

        Maybe you need CDateTimeCtrl::SetFormat().

        L Offline
        L Offline
        Lodeclaw
        wrote on last edited by
        #3

        Can you elaborate?

        D 1 Reply Last reply
        0
        • L Lodeclaw

          Hi there. I'm trying to set the format of my DateTimeControls to yyyy/mm/dd but the only method I can find is through the localeid property. The only locales that use yyyy/mm/dd as their primary format are non-english, so they don't help me much. The government standard in Canada (where I am) is yyyy/mm/dd but as a nation all three primary formats are used. Is there any way to select which format I want to use, or am I stuck with Microsoft's default, dd/mm/yyyy? Thanks ahead of time for any assistance!

          D Offline
          D Offline
          daveyerwin
          wrote on last edited by
          #4

          I have an mfc dialog containing a DateTimePicker, I have assigned it the variable "picker", I have formated the dates to year month day with this command ...

          picker.SetFormat("yyyymmdd");

          1 Reply Last reply
          0
          • L Lodeclaw

            Can you elaborate?

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            See here.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            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