Adbase
Adinf C++ base library V2
|
时区工具类 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... | |
时区工具类
Definition at line 29 of file TimeZone.hpp.
|
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.
|
inline |
Definition at line 33 of file TimeZone.hpp.
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().
|
static |
|
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.
struct tm adbase::TimeZone::toLocalTime | ( | time_t | secondsSinceEpoch | ) | const |
Definition at line 236 of file TimeZone.cpp.
References adbase::TimeZone::Data::abbreviation, adbase::detail::Localtime::arrbIdx, adbase::detail::findLocaltime(), adbase::detail::Localtime::gmtOffset, and adbase::detail::Localtime::isDst.
Referenced by fromLocalTime(), and adbase::http::Server::setLocationFallback().
|
static |
gmtime(3)
Definition at line 282 of file TimeZone.cpp.
References adbase::Date::YearMonthDay::day, adbase::detail::fillHMS(), adbase::Date::julianDayNumber(), adbase::Date::kJulianDayOf1970_01_01, adbase::kSecondsPerDay, adbase::Date::YearMonthDay::month, adbase::Date::weekDay(), adbase::Date::YearMonthDay::year, and adbase::Date::yearMonthDay().
|
inline |
Definition at line 36 of file TimeZone.hpp.
References fromLocalTime(), and fromUtcTime().
Referenced by adbase::http::Server::setLocationFallback().