mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 06:36:37 +01:00
trunk: backport eventing from 1.4.3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Timezone_UNIX.cpp
|
||||
//
|
||||
// $Id: //poco/1.4/Foundation/src/Timezone_UNIX.cpp#1 $
|
||||
// $Id: //poco/1.4/Foundation/src/Timezone_UNIX.cpp#2 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: DateTime
|
||||
@@ -49,13 +49,13 @@ public:
|
||||
{
|
||||
tzset();
|
||||
}
|
||||
|
||||
int timeZone()
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(POCO_ANDROID) // no timezone global var
|
||||
std::time_t now = std::time(NULL);
|
||||
struct std::tm t;
|
||||
gmtime_r(&now, &t);
|
||||
|
||||
int timeZone()
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(POCO_ANDROID) // no timezone global var
|
||||
std::time_t now = std::time(NULL);
|
||||
struct std::tm t;
|
||||
gmtime_r(&now, &t);
|
||||
std::time_t utc = std::mktime(&t);
|
||||
return now - utc;
|
||||
#elif defined(__CYGWIN__)
|
||||
|
||||
Reference in New Issue
Block a user