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. How to get the format of users local date and time?

How to get the format of users local date and time?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
2 Posts 2 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.
  • H Offline
    H Offline
    Hemant kulkarni
    wrote on last edited by
    #1

    Hi, In my one application I ma having a MFC CDateTimeCtrl control. The requirement is that, the format of date and time of this control and the users local date and time should be same. Means if users format is 24hr clock my control should also display the time in 24hr format. I have following two questions regarding this. 1] How I can know that user changed the format of his time? (I can find the time change by ON_WM_TIMECHANGE message but what if user changed only format and not the time?) 2] How to get the current format of users local date and time? Regards, Hemant kulkarni

    K 1 Reply Last reply
    0
    • H Hemant kulkarni

      Hi, In my one application I ma having a MFC CDateTimeCtrl control. The requirement is that, the format of date and time of this control and the users local date and time should be same. Means if users format is 24hr clock my control should also display the time in 24hr format. I have following two questions regarding this. 1] How I can know that user changed the format of his time? (I can find the time change by ON_WM_TIMECHANGE message but what if user changed only format and not the time?) 2] How to get the current format of users local date and time? Regards, Hemant kulkarni

      K Offline
      K Offline
      kasturi_haribabu
      wrote on last edited by
      #2

      consider using COleDateTime. COleDateTime::Format CString Format( DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT ); haribabu

      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