TZ-Lib
$VERSION$
|
Classes | |
class | PosixRule |
class | TZFile |
class | TZRule |
Functions | |
qint64 | dateTime2stamp (qint64 days, quint8 h, quint8 m, quint8 s) |
qint64 | dateTime2stamp (int y, quint8 mon, quint8 day, quint8 hr, quint8 min, quint8 s) |
qint64 | daysSinceEpoch (int year, int month=1, int day=1) |
qint64 | decodeInt (const QByteArray &a, int s=4) |
qint64 | decodeInt64 (const QByteArray &a) |
qint64 | fdiv (qint64 num, qint64 div) |
qint64 | firstWeekDayOf (int year, int month, int wday) |
TZLIB_EXPORT TZFile & | getRegistryZone (QString zn) |
bool | isLeapYear (int year) |
qint64 | lastWeekDayOf (int year, int month, int wday) |
void | offset2Date (qint64 off, qint16 &y, quint8 &m, quint8 &d) |
int | pmod (qint64 num, int mod) |
void | setSystemZoneFile (QString) |
void | stamp2Date (qint64 off, qint16 &y, quint8 &m, quint8 &d) |
void | stamp2Time (qint64 stamp, quint8 &h, quint8 &m, quint8 &s) |
QString | systemDefaultDiscover () |
int | weekDayOf (int year, int month=1, int day=1) |
int | weekDaySinceEpoch (qint64 daySinceEpoch) |
Variables | |
static const qint64 | SecondsPerDay =86400 |
|
inline |
converts date and time to a time stamp, UTC is assumed
days | the date in days since Epoch |
h:m:s | exact time of the day (0<=h<24) |
References SecondsPerDay.
Referenced by dateTime2stamp(), and TimeStamp::moveToZone().
|
inline |
converts date and time to a time stamp, UTC is assumed
y | year |
mon | the month (1-12) |
day | day of the month (1-31) |
hr:min:s | exact time of the day (0<=hr<24) |
References dateTime2stamp(), and daysSinceEpoch().
|
inline |
returns how many days have passed since Epoch to this day
year | the year to be calculated |
month | the month to be calculates, must be between 1 and 12, assumes january if none given |
day | the day of the month to be calculated, must be between 1 and 31, assumes the 1st if none given |
References isLeapYear().
Referenced by calcTimeStamp(), dateTime2stamp(), firstWeekDayOf(), lastWeekDayOf(), TimeZoneLib::PosixRule::rulesForYear(), and weekDayOf().
|
inline |
decodes a signed big endian integer from a byte array, per default it decodes a 32bit int
a | the array, it must be at least s bytes long |
s | the length of the int in bytes |
Referenced by decodeInt64().
|
inline |
convenience function: decodes a 64bit integer from an array, see decodeInt
References decodeInt().
|
inline |
Referenced by TimeStamp::addMSecs(), and stamp2Date().
|
inline |
returns the first day in a month that is a specific day of the week, 0 and 7 are sunday
References daysSinceEpoch(), pmod(), and weekDaySinceEpoch().
TZFile & TimeZoneLib::getRegistryZone | ( | QString | zn | ) |
|
inline |
returns true if the given year is a leap year according to the Gregorian calendar
Referenced by calcTimeStamp(), daysSinceEpoch(), and offset2Date().
|
inline |
returns the last day in a month that is a specific day of the week, 0 and 7 are sunday
References daysSinceEpoch(), pmod(), and weekDaySinceEpoch().
Referenced by calcTimeStamp().
|
inline |
returns the date represented by this offset from Epoch (in days)
References isLeapYear().
Referenced by stamp2Date().
|
inline |
Referenced by TimeStamp::addMSecs(), firstWeekDayOf(), lastWeekDayOf(), stamp2Time(), weekDayOf(), and weekDaySinceEpoch().
void TimeZoneLib::setSystemZoneFile | ( | QString | z | ) |
References systemZone.
Referenced by systemDefaultDiscover().
|
inline |
converts the time stamp to a date (assumes UTC)
References fdiv(), and offset2Date().
Referenced by TimeZoneLib::PosixRule::nextRule(), TimeZoneLib::PosixRule::ruleForLocalTime(), and TimeZoneLib::PosixRule::ruleForTime().
|
inline |
returns the time represented by this unix timestamp for UTC
References pmod().
QString TimeZoneLib::systemDefaultDiscover | ( | ) |
References efiles, setSystemZoneFile(), and tfiles.
Referenced by TimeStamp::setDefaultZone().
|
inline |
returns the week day of a specific date
year | the year to be calculated |
month | the month to be calculates, must be between 1 and 12, assumes january if none given |
day | the day of the month to be calculated, must be between 1 and 31, assumes the 1st if none given |
References daysSinceEpoch(), and pmod().
Referenced by TimeStamp::weekDay().
|
inline |
returns the week day of a specific day offset from Epoch
References pmod().
Referenced by firstWeekDayOf(), and lastWeekDayOf().
|
static |
the amount of seconds per Day
Referenced by TimeStamp::addDays(), calcTimeStamp(), dateTime2stamp(), and TimeZoneLib::PosixRule::rulesForYear().