version 1.73, 2006/09/15 17:24:20
|
version 1.74, 2006/09/15 17:42:28
|
|
|
| |
time_t sec; | time_t sec; |
Uint64 usec; | Uint64 usec; |
{ |
|
// ATTN: if this fails on your platform, use time() to obtain the | // ATTN: if this fails on your platform, use time() to obtain the |
// sec element and set usec to zero. | // sec element and set usec to zero. |
struct timeval tv; | struct timeval tv; |
gettimeofday(&tv, NULL); |
struct timezone tz; |
|
gettimeofday(&tv, &tz); |
sec = tv.tv_sec; | sec = tv.tv_sec; |
usec = Uint64(tv.tv_usec); | usec = Uint64(tv.tv_usec); |
} |
|
| |
// Get the localtime | // Get the localtime |
| |
|
|
# elif defined(PEGASUS_OS_LINUX) | # elif defined(PEGASUS_OS_LINUX) |
tzMinutesEast = (int) tmval->tm_gmtoff/60; | tzMinutesEast = (int) tmval->tm_gmtoff/60; |
# else | # else |
struct timeval tv; |
if (tz.tz_dsttime > 0) |
struct timezone tz; |
|
gettimeofday(&tv, &tz); |
|
tzMinutesEast = -tz.tz_minuteswest; | tzMinutesEast = -tz.tz_minuteswest; |
|
else |
|
// ATTN: It is unclear how to determine the DST offset. |
|
// Assume 1 hour. |
|
tzMinutesEast = -tz.tz_minuteswest + 60; |
# endif | # endif |
} | } |
| |