POCO C++库学习和分析-- 日期与时间(2)
18. DECEMBER 19. }; 20.
21. enum DaysOfWeek
22. /// Symbolic names for week day numbers (0 to 6). 23. {
24. SUNDAY = 0, 25. MONDAY, 26. TUESDAY, 27. WEDNESDAY, 28. THURSDAY, 29. FRIDAY, 30. SATURDAY 31. }; 32. 33. DateTime();
34. /// Creates a DateTime for the current date and time. 35. 36.
37. DateTime(const Timestamp& timestamp);
38. /// Creates a DateTime for the date and time given in 39. /// a Timestamp. 40.
41. DateTime(int year, int month, int day, int hour = 0, int minute = 0, int 42. 43.
44. second = 0, int millisecond = 0, int microsecond = 0);
45. /// Creates a DateTime for the given Gregorian date and time. 46. /// * year is from 0 to 9999. 47. /// * month is from 1 to 12. 48. /// * day is from 1 to 31. 49. /// * hour is from 0 to 23. 50. /// * minute is from 0 to 59. 51. /// * second is from 0 to 59. 52. /// * millisecond is from 0 to 999. 53. /// * microsecond is from 0 to 999. 54. 55.
56. DateTime(double julianDay);
57. /// Creates a DateTime for the given Julian day. 58. 59.
60. DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff); 61. /// Creates a DateTime from an UtcTimeVal and a TimeDiff. 62. ///
63. /// Mainly used internally by DateTime and friends. 64. 65.
66. DateTime(const DateTime& dateTime);
67. /// Copy constructor. Creates the DateTime from another one. 68. 69.
70. ~DateTime();
71. /// Destroys the DateTime. 72. 73.
74. DateTime& operator = (const DateTime& dateTime); 75. /// Assigns another DateTime. 76.
77. DateTime& operator = (const Timestamp& timestamp); 78. /// Assigns a Timestamp. 79. 80.
81. DateTime& operator = (double julianDay); 82. /// Assigns a Julian day. 83. 84.
85. DateTime& assign(int year, int month, int day, int hour = 0, int minute = 0, 86. 87.
88. int second = 0, int millisecond = 0, int microseconds = 0); 89. /// Assigns a Gregorian date and time. 90. /// * year is from 0 to 9999. 91. /// * month is from 1 to 12. 92. /// * day is from 1 to 31. 93. /// * hour is from 0 to 23. 94. /// * minute is from 0 to 59. 95. /// * second is from 0 to 59. 96. /// * millisecond is from 0 to 999. 97. /// * microsecond is from 0 to 999. 98. 99.
100. void swap(DateTime& dateTime);
101. /// Swaps the DateTime with another one. 102. 103.
104. int year() const;
105. /// Returns the year. 106.
107. int month() const;
108. /// Returns the month (1 to 12). 109.
110. int week(int firstDayOfWeek = MONDAY) const; 111. /// Returns the week number within the year.
112. /// FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1). 113. /// The returned week number will be from 0 to 53. Week number 1 is 114. 115.
116. the week
117. /// containing January 4. This is in accordance to ISO 8601. 118. ///
119. /// The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started
120. /// on a Saturday, week 1 will be the week starting on Monday, January 3.
121. /// January 1 and 2 will fall within week 0 (or the last week of the previous year). 122. ///
123. /// For 2007, which starts on a Monday, week 1 will be the week 124. 125.
126. startung on Monday, January 1.
127. /// There will be no week 0 in 2007. 128.
129. int day() const;
130. /// Returns the day witin the month (1 to 31). 131.
132. int dayOfWeek() const;
133. /// Returns the weekday (0 to 6, where
134. /// 0 = Sunday, 1 = Monday, ..., 6 = Saturday). 135.
136. int dayOfYear() const;
137. /// Returns the number of the day in the year. 138. /// January 1 is 1, February 1 is 32, etc. 139.
140. int hour() const;
141. /// Returns the hour (0 to 23). 142.
143. int hourAMPM() const;
144. /// Returns the hour (0 to 12). 145.
146. bool isAM() const;
147. /// Returns true if hour < 12; 148. 149.
150. bool isPM() const;
151. /// Returns true if hour >= 12. 152.
153. int minute() const;
154. /// Returns the minute (0 to 59). 155.
156. int second() const;
157. /// Returns the second (0 to 59). 158.
159. int millisecond() const;
160. /// Returns the millisecond (0 to 999) 161.
162. int microsecond() const;
163. /// Returns the microsecond (0 to 999)
164.
165. double julianDay() const;
166. /// Returns the julian day for the date and time. 167.
168. Timestamp timestamp() const;
169. /// Returns the date and time expressed as a Timestamp. 170. 171.
172. Timestamp::UtcTimeVal utcTime() const;
173. /// Returns the dat …… 此处隐藏:4223字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [综合文档]应答器设备技术规范(征求意见稿)A1
- [综合文档]教师 2012年高考政治试题按考点分类汇
- [综合文档]保险公司的总经理助理竞职演说
- [综合文档]卫生应急大练兵大比武活动考试--题库(
- [综合文档]徐州经济技术开发区总体规划环境影响报
- [综合文档]汉语拼音表(带声调)
- [综合文档]二年级 上 思维训练( 1~18)
- [综合文档]特色学校五年发展规划
- [综合文档]机床经常出现报警“X1轴定位监控”
- [综合文档]《电子技术基础》21.§5—2、3、4 习题
- [综合文档]浙江省深化普通高中课程改革
- [综合文档]CRISP原理 - 图文
- [综合文档]2017年电大社会调查研究与方法形考答案
- [综合文档]浅析建筑施工安全毕业论文
- [综合文档]《回忆我的母亲》名师教案
- [综合文档]装饰装修工程监理规划
- [综合文档]三下乡心得体会-文艺
- [综合文档]柱计算长度系数 - 图文
- [综合文档]全流程思考,提高燃电系统热电转换率--
- [综合文档]2018年嘉定区中考物理一模含答案
- 433M车库门滚动码遥控器
- 8、架空线路施工规范
- 大学四年声乐学习的体会
- 新北师大版五年级数学上册《轴对称再认
- 部编版五年级上册语文第六单元小结复习
- 小学六年级英语形容词用法
- 第2课 抗美援朝保家卫国 课件01(岳麓版
- 2015年天津大学运筹学基础考研真题,考
- 微机计算机控制技术课后于海生(第2版)
- 安全教育实践活动
- Delphi程序设计教程_第1章_Delphi概述
- 第八讲 工业革命与启蒙运动
- 《中华人民共和国药典》2005年版二部勘
- 科粤版九年级化学2.3构成物质的微粒(1)
- 西师大版数学三年级下册《长方形、正方
- ch6_冒泡排序演示
- 第4章 冲裁模具设计
- 浙江中小民营企业员工流失论文[终稿]
- 再议有线数字电视市场营运模式
- 昆明供水工程监理大纲




