mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
downloader: Correct lack of timezone
- Use tm_gmtoff for GMT correction under FreeBSD Signed-off-by: deflected <deflected@github>
This commit is contained in:
parent
2dd1b5e3b3
commit
d82f2c83cd
@ -223,8 +223,14 @@ HTTPDate(const string &format) {
|
|||||||
if (_time != (time_t)-1) {
|
if (_time != (time_t)-1) {
|
||||||
// Unfortunately, mktime() assumes local time; convert this back
|
// Unfortunately, mktime() assumes local time; convert this back
|
||||||
// to GMT.
|
// to GMT.
|
||||||
|
#ifdef IS_FREEBSD
|
||||||
|
time_t now = time(NULL);
|
||||||
|
struct tm *tp = localtime(&now);
|
||||||
|
_time -= tp->tm_gmtoff;
|
||||||
|
#else /* IS_FREEBSD */
|
||||||
extern long int timezone;
|
extern long int timezone;
|
||||||
_time -= timezone;
|
_time -= timezone;
|
||||||
|
#endif /* IS_FREEBSD */
|
||||||
}
|
}
|
||||||
#endif // __GNUC__
|
#endif // __GNUC__
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user