设为首页 加入收藏

TOP

POCO C++库学习和分析 -- 日期与时间 (四)
2014-11-24 03:20:57 】 浏览:1131
Tags:POCO 学习 分析 --日期 时间
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 a DateTime for the current date and time.


DateTime(const Timestamp& timestamp);
/// Creates a DateTime for the date and time given in
/// a Timestamp.

DateTime(int year, int month, int day, int hour = 0, int minute = 0, int


second = 0, int millisecond = 0, int microsecond = 0);
/// Creates a DateTime for the given Gregorian date and time.
/// * year is from 0 to 9999.
/// * month is from 1 to 12.
/// * day is from 1 to 31.
/// * hour is from 0 to 23.
/// * minute is from 0 to 59.
/// * second is from 0 to 59.
/// * millisecond is from 0 to 999.
/// * microsecond is from 0 to 999.


DateTime(double julianDay);
/// Creates a DateTime for the given Julian day.


DateTime(Timestamp::UtcTimeva l utcTime, Timestamp::TimeDiff diff);
/// Creates a DateTime from an UtcTimeva l and a TimeDiff.
///
/// Mainly used internally by DateTime and friends.


DateTime(const DateTime& dateTime);
/// Copy constructor. Creates the DateTime from another one.


~DateTime();
/// Destroys the DateTime.


DateTime& operator = (const DateTime& dateTime);
/// Assigns another DateTime.

DateTime& operator = (const Timestamp& timestamp);
/// Assigns a Timestamp.


DateTime& operator = (double julianDay);
/// Assigns a Julian day.


DateTime& assign(int year, int month, int day, int hour = 0, int minute = 0,


int second = 0, int millisecond = 0, int microseconds = 0);
/// Assigns a Gregorian date and time.
/// * year is from 0 to 9999.
/// * month is from 1 to 12.
/// * day is from 1 to 31.
/// * hour is from 0 to 23.
/// * minute is from 0 to 59.
/// * second is from 0 to 59.
/// * millisecond is from 0 to 999.
/// * microsecond is from 0 to 999.


void swap(DateTime& dateTime);
/// Swaps the DateTime with another one.


int year() const;
/// Returns the year.

int month() const;
/// Returns the month (1 to 12).

int week(int firstDayOfWeek = MONDAY) const;
/// Returns the week number within the year.
/// FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1).
/// The returned week number will be from 0 to 53. Week number 1 is


the week
/// containing January 4. This is in accordance to ISO 8601.
///
/// The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started
/// on a Saturday, week 1 will be the week starting on Monday, January 3.
/// January 1 and 2 will fall within week 0 (or the last week of the previous year).
///
/// For 2007, which starts on a Monday, week 1 will be the week


startung on Monday, January 1.
/// There will be no week 0 in 2007.

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

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目