Header File
sys\timeb.h
Category
Time and Date Routines
Prototype
void ftime(struct timeb *buf)
Description
Stores current time in timeb structure.
On UNIX platforms ftime is available only on System V systems.
ftime determines the current time and fills in the fields in the timeb structure pointed to by buf. The timeb structure contains four fields: time, millitm, _timezone, and dstflag:
struct timeb {
long time ;
short millitm ;
short _timezone ;
short dstflag ;
};
None.
Example
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys\timeb.h> /* pacific standard & daylight savings */ char *tzstr = "TZ=PST8PDT"; int main(void) { struct timeb t; putenv(tzstr); tzset(); ftime(&t); printf("Seconds since 1/1/1970 GMT: %ld\n", t.time); printf("Thousandths of a second: %d\n", t.millitm); printf("Difference between local time and GMT: %d\n", t._timezone); printf("Daylight savings in effect (1) not (0): %d\n", t.dstflag); return 0; }
Portability
POSIX |
Win32 |
ANSI C |
ANSI C++ |
|
+ |
|
|
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|