From c4b2e9feea372b4554502ad9407e3d5fa4b8fa77 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Thu, 18 Jul 2002 21:21:37 +0000 Subject: [PATCH] Fixed get_timezone for real this time. svn path=/trunk/boinc/; revision=221 --- client/hostinfo_unix.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/hostinfo_unix.C b/client/hostinfo_unix.C index 407bb89469..488c08f10d 100644 --- a/client/hostinfo_unix.C +++ b/client/hostinfo_unix.C @@ -121,12 +121,20 @@ char* ip_addr_string(int ip_addr) { // Returns the number of seconds difference from UTC // int get_timezone( void ) { + tzset(); + // TODO: take daylight savings time into account +#ifdef __timezone + tz = __timezone; +#elif timezone + tz = timezone; +#else time_t cur_time; struct tm *time_data; cur_time = time(NULL); time_data = localtime( &cur_time ); return time_data->tm_gmtoff; +#endif } // Returns true if the host is currently running off battery power