D import syntax works again
[delight/core.git] / phobos2 / gcc / cbridge_time.c
blob34faebfe69743fbc1b122df8b0231014e0c0669d
1 #include <time.h>
2 #include "config.h"
4 time_t _d_gnu_cbridge_tza()
6 time_t t;
7 struct tm * p_tm;
9 time(&t);
10 p_tm = localtime(&t); /* this will set timezone */
12 #if defined(HAVE_TIMEZONE)
13 return - timezone;
14 #elif defined(HAVE__TIMEZONE)
15 return - _timezone;
16 #elif HAVE_TM_GMTOFF_AND_ZONE
17 /* std.date expects this value to not include
18 the daylight saving time offset. */
19 if (p_tm->tm_isdst)
20 /* std.date assumes daylight saving time is a one hour offset,
21 so no attempt is made determine the correct offset */
22 return p_tm->tm_gmtoff - 3600;
23 return p_tm->tm_gmtoff;
24 #else
25 return (time_t) 0;
26 #endif