mirror of https://github.com/BOINC/boinc.git
Fixed get_timezone for real this time.
svn path=/trunk/boinc/; revision=221
This commit is contained in:
parent
cd8ce7e17a
commit
c4b2e9feea
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue