设为首页 加入收藏

TOP

POCO C++库学习和分析 -- 日期与时间 (六)
2014-11-24 03:20:57 】 浏览:1138
Tags:POCO 学习 分析 --日期 时间
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 the 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 dat

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

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目