Adbase
Adinf C++ base library V2
adbase::TimeZone Class Reference

时区工具类 More...

#include <TimeZone.hpp>

Classes

struct  Data
 

Public Member Functions

 TimeZone (const char *zonefile)
 
 TimeZone (int eastOfUtc, const char *tzname)
 
 TimeZone ()
 
bool valid () const
 
struct tm toLocalTime (time_t secondsSinceEpoch) const
 
time_t fromLocalTime (const struct tm &) const
 

Static Public Member Functions

static struct tm toUtcTime (time_t secondsSinceEpoch, bool yday=false)
 gmtime(3) More...
 
static time_t fromUtcTime (const struct tm &)
 timegm(3) More...
 
static time_t fromUtcTime (int year, int month, int day, int hour, int minute, int seconds)
 year in [1900..2500], month in [1..12], day in [1..31] More...
 

Detailed Description

时区工具类

Definition at line 29 of file TimeZone.hpp.

Constructor & Destructor Documentation

adbase::TimeZone::TimeZone ( const char *  zonefile)
explicit

Definition at line 217 of file TimeZone.cpp.

References adbase::detail::readTimeZoneFile().

adbase::TimeZone::TimeZone ( int  eastOfUtc,
const char *  tzname 
)

Definition at line 227 of file TimeZone.cpp.

adbase::TimeZone::TimeZone ( )
inline

Definition at line 33 of file TimeZone.hpp.

Member Function Documentation

time_t adbase::TimeZone::fromLocalTime ( const struct tm &  localTm) const

Definition at line 259 of file TimeZone.cpp.

References adbase::detail::findLocaltime(), adbase::detail::Localtime::gmtOffset, and toLocalTime().

Referenced by valid().

time_t adbase::TimeZone::fromUtcTime ( const struct tm &  utc)
static

timegm(3)

Definition at line 310 of file TimeZone.cpp.

Referenced by valid().

time_t adbase::TimeZone::fromUtcTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  seconds 
)
static

year in [1900..2500], month in [1..12], day in [1..31]

Definition at line 318 of file TimeZone.cpp.

References adbase::Date::julianDayNumber(), and adbase::Date::kJulianDayOf1970_01_01.

bool adbase::TimeZone::valid ( ) const
inline

Definition at line 36 of file TimeZone.hpp.

References fromLocalTime(), and fromUtcTime().

Referenced by adbase::http::Server::setLocationFallback().


The documentation for this class was generated from the following files: