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. DATETIMEPICKER

DATETIMEPICKER

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 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.
  • D Offline
    D Offline
    durban2
    wrote on last edited by
    #1

    There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?

    S C 2 Replies Last reply
    0
    • D durban2

      There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      If dd.mm.yyyy was the date format in your regional settings, you could just do this:

      m_Date = COleDateTime(m_sBD);
      UpdateData(FALSE);

      If not, you need to parse the string yourself:

      int year, month, day;
      _tscanf((LPCTSTR)m_sBD, "%d.%d.%d", &day, &month, &year);
      m_Date = COleDateTime(year, month, day);
      UpdateData(FALSE);

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      • D durban2

        There is control on the dialog window DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_date); COleDateTime m_date; CString m_sBD; m_sBD have format ‘dd.mm.yyyy’ for example m_sBD = L”19.05.1849”; How do show date into control that identifier is IDC_DATETIMEPICKER1?

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        I didn't know that you could associate a COleDateTime variable with a CDateTimePicker but after testing it, it seems possible. So, what you will need to do is set the new date in your m_date object and then update your dialog to show the changes. The first step can be done by calling COleDateTime::ParseDateTime[^] The second step can be done by calling UpdateData(FALSE) in your dialog class.

        Cédric Moonen Software developer
        Charting control [v2.0] OpenGL game tutorial in C++

        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