1 // Copyright 2017 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "xfa/fxfa/parser/cxfa_timezoneprovider.h" 8 9 #include <stdlib.h> 10 #include <time.h> 11 12 #include "build/build_config.h" 13 14 static bool g_bProviderTimeZoneSet = false; 15 16 #if BUILDFLAG(IS_WIN) 17 #define TIMEZONE _timezone 18 #define TZSET _tzset 19 #else 20 #define TZSET tzset 21 #define TIMEZONE timezone 22 #endif 23 CXFA_TimeZoneProvider()24CXFA_TimeZoneProvider::CXFA_TimeZoneProvider() { 25 if (!g_bProviderTimeZoneSet) { 26 g_bProviderTimeZoneSet = true; 27 TZSET(); 28 } 29 tz_minutes_ = TIMEZONE / -60; 30 } 31 32 CXFA_TimeZoneProvider::~CXFA_TimeZoneProvider() = default; 33