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. Retreiving system time.

Retreiving system time.

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

    Hi all, To reteive the system time i used CTime::GetCurrentTime(); When the return value is formatted I got the systm time in HOUR,MINUTES and SECONDS format..is there any function using which i can get 100th of a second also??? Thanks in advance Rajeev

    S Mircea PuiuM 2 Replies Last reply
    0
    • R rajeev82

      Hi all, To reteive the system time i used CTime::GetCurrentTime(); When the return value is formatted I got the systm time in HOUR,MINUTES and SECONDS format..is there any function using which i can get 100th of a second also??? Thanks in advance Rajeev

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      you can call GetAsSystemTime function of CTime to get SYSTEMTIME structure used to store the time. from that you can access milliseconds and other information supported one more. GetAsDBTIMESTAMP is also there you can get the fraction represents billionths of a second ranging from 0 to 999,999,999. Note This method is only available when OLEDB.h is included. See MSDN for more details. -- modified at 2:14 Friday 18th August, 2006

      SaRath.
      _"Before you can learn to recognize what's wrong, you must learn to recognize what's right" - Raymond Chen."


      My Blog | Understanding State Pattern_

      1 Reply Last reply
      0
      • R rajeev82

        Hi all, To reteive the system time i used CTime::GetCurrentTime(); When the return value is formatted I got the systm time in HOUR,MINUTES and SECONDS format..is there any function using which i can get 100th of a second also??? Thanks in advance Rajeev

        Mircea PuiuM Offline
        Mircea PuiuM Offline
        Mircea Puiu
        wrote on last edited by
        #3

        Use GetSystemTime(**LPSYSTEMTIME** lpSystemTime), which works with a pointer to SYSTEMTIME as argument:

        typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
        } SYSTEMTIME;

        SkyWalker

        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