Example: ftime

The following example uses ftime to print out some details of the system time.

    #include <stdio.h>
    #include <time.h>
    struct _timeb {
        time_t time;
        unsigned short millitm;
        short timezone;
        short dstflag;
    };
    struct _timeb t;
// Sets variables used by ftime
    _tzset(); 
    _ftime( &t );
    lr_message ("Plus milliseconds: %u", t.millitm);
    lr_message ("Timezone difference from UTC: %d secs", t.timezone);
    lr_message ("Daylight savings: %s", t.dstflag ? "YES" : "NO");}
Output:
Plus milliseconds: 637
Timezone difference from UTC: -120 secs
Daylight savings: NO