设为首页 加入收藏

TOP

POCO C++库学习和分析 -- 日期与时间 (五)
2014-11-24 03:20:57 】 浏览:1133
Tags:POCO 学习 分析 --日期 时间
e day witin the month (1 to 31).

int dayOfWeek() const;
/// Returns the weekday (0 to 6, where
/// 0 = Sunday, 1 = Monday, ..., 6 = Saturday).

int dayOfYear() const;
/// Returns the number of the day in the year.
/// January 1 is 1, February 1 is 32, etc.

int hour() const;
/// Returns the hour (0 to 23).

int hourAMPM() const;
/// Returns the hour (0 to 12).

bool isAM() const;
/// Returns true if hour < 12;


bool isPM() const;
/// Returns true if hour >= 12.

int minute() const;
/// Returns the minute (0 to 59).

int second() const;
/// Returns the second (0 to 59).

int millisecond() const;
/// Returns the millisecond (0 to 999)

int microsecond() const;
/// Returns the microsecond (0 to 999)

double julianDay() const;
/// Returns the julian day for the date and time.

Timestamp timestamp() const;
/// Returns the date and time expressed as a Timestamp.


Timestamp::UtcTimeva l utcTime() const;
/// Returns the date and time expressed in UTC-based
/// time. UTC base time is midnight, October 15, 1582.
/// Resolution is 100 nanoseconds.

bool operator == (const DateTime& dateTime) const;
bool operator != (const DateTime& dateTime) const;
bool operator < (const DateTime& dateTime) const;
bool operator <= (const DateTime& dateTime) const;
bool operator > (const DateTime& dateTime) const;
bool operator >= (const DateTime& dateTime) const;


DateTime operator + (const Timespan& span) const;
DateTime operator - (const Timespan& span) const;
Timespan operator - (const DateTime& dateTime) const;
DateTime& operator += (const Timespan& span);
DateTime& operator -= (const Timespan& span);

void makeUTC(int tzd);
/// Converts a local time into UTC, by applying the given time zone


differential.

void makeLocal(int tzd);
/// Converts a UTC time into a local time, by applying the given time


zone differential.

static bool isLeapYear(int year);
/// Returns true if the given year is a leap year;
/// false otherwise.

static int daysOfMonth(int year, int month);
/// Returns the number of days in the given month
/// and year. Month is from 1 to 12.

static bool isValid(int year, int month, int day, int hour = 0, int minute =


0, int second = 0, int millisecond = 0, int microsecond = 0);
/// Checks if the given date and time is valid
/// (all arguments are within a proper range).
///
/// Returns true if all arguments are valid, false otherwise.

protected:
// ...

private:
// ...

Timestamp::UtcTimeva l _utcTime;
short _year;
short _month;
short _day;
short _hour;
short _minute;
short _second;
short _millisecond;
short _microsecond;
};

class Foundation_API DateTime
{
public:
enum Months
/// Symbolic names for month numbers (1 to 12).
{
JANUARY = 1,
FEBRUARY,
MARCH,
APRIL,
MAY,
JUNE,
JULY,
AUGUST,
SEPTEMBER,
OCTOBER,
NOVEMBER,
DECEMBER
};

enum DaysOfWeek
/// Symbolic names for week day numbers (0 to 6).
{
SUNDAY = 0,
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY
};

DateTime();
/// Creates

首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/12/12
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇fzu 2035 Axial symmetry(几何) 下一篇BZOJ 2565 最长双回文串

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目