Fixed get_timezone for real this time.

svn path=/trunk/boinc/; revision=221
This commit is contained in:
Eric Heien 2002-07-18 21:21:37 +00:00
parent cd8ce7e17a
commit c4b2e9feea
1 changed files with 8 additions and 0 deletions

View File

@ -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