Changeset: 57309882b1a8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57309882b1a8
Modified Files:
clients/mapiclient/mclient.c
Branch: Dec2011
Log Message:
mclient: Fixed determination whether we're currently using DST.
The daylight variable only specifies whether at any time of the year
there is DST, not whether it is currently being used. For that we now
use the localtime() function with the current time.
diffs (25 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2474,16 +2474,16 @@ set_timezone(Mapi mid)
#ifdef HAVE_TIMEZONE
#ifdef _MSC_VER
#define timezone _timezone
-#define daylight _daylight
-#define tzset _tzset
#endif
char buf[128];
+ struct tm *tm;
+ time_t t;
long tzone;
MapiHdl hdl;
- /* timezone and daylight are POSIX-defined variables */
- tzset();
- tzone = timezone - 3600 * daylight;
+ t = time(NULL);
+ tm = localtime(&t);
+ tzone = timezone - 3600 * tm->tm_isdst;
if (tzone < 0)
snprintf(buf, sizeof(buf),
"SET TIME ZONE INTERVAL '+%02ld:%02ld' HOUR TO MINUTE",
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list