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. date/time

date/time

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
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.
  • O Offline
    O Offline
    ozgul
    wrote on last edited by
    #1

    How can i get the locale system time and date? Can u give some examples? Please help me.. Thanks everybody...

    A Z 2 Replies Last reply
    0
    • O ozgul

      How can i get the locale system time and date? Can u give some examples? Please help me.. Thanks everybody...

      A Offline
      A Offline
      Anthony_Yio
      wrote on last edited by
      #2

      Try this, a simple one (MFC)

      CTime t = CTime::GetCurrentTime();

      struct tm* osTime; // A pointer to a time structure (TIME.H)
      osTime = t.GetLocalTm( NULL );
      ASSERT( osTime->tm_mon == 2 ); // Note zero-based month!

      Sonork 100.41263:Anthony_Yio

      1 Reply Last reply
      0
      • O ozgul

        How can i get the locale system time and date? Can u give some examples? Please help me.. Thanks everybody...

        Z Offline
        Z Offline
        Zeeshan Bilal
        wrote on last edited by
        #3

        i hope following will help u CTime stime = CTime::GetCurrentTime(); CString s = stime.Format("%A, %B %d, %Y,%I:%M : %S :%p" ); AfxMessageBox(s); chk it take care

        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