Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>ftime() get current system time as structure</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ftime()                 Get Current System Time as Structure

 #include   <sys\types.h>
 #include   <sys\timeb.h>

 void           ftime(timeptr);
 struct timeb   *timeptr;                Structure defined in <sys\timeb.h>

    ftime() gets and stores the current time in the structure pointed to
    by 'timeptr'. The 'timeb' structure is defined in <sys\timeb.h> and
    contains the following four fields and values:

         'time'     The time in seconds since 00:00:00 Greenwich mean
                    time, January 1, 1970.

      'millitm'     Fractions of a second in milliseconds.

     'timezone'     The difference between Greenwich mean time and local
                    time, measured in minutes from east to west; set from
                    the global variable 'timezone' (see tzset()).

      'dstflag'     Indicator of daylight saving time; nonzero if
                    daylight saving time is set from the global variable
                    'daylight' (see tzset()).

    Returns:    The values in fields of the structure pointed to by
                'timeptr'. No return value in and of itself.

 Portability:   Not supported by ANSI standard.

   -------------------------------- Example ---------------------------------

    The following statements get the elapsed time and convert it to a
    character string.

           #include <sys\types.h>
           #include <sys\timeb.h>
           #include <time.h>
           #include <stdio.h>

           struct timeb elapstime;
           char *timestr;

           main()
           {
               ftime(&elapstime);
               timestr = ctime(&(elapstime.time));
           }



See Also: asctime() ctime() time() tzset()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson