class_qwt_date.html 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.20"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Qwt User&#39;s Guide: QwtDate Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectalign" style="padding-left: 0.5em;">
  28. <div id="projectname">Qwt User&#39;s Guide
  29. &#160;<span id="projectnumber">6.1.6</span>
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <!-- end header part -->
  37. <!-- Generated by Doxygen 1.8.20 -->
  38. <script type="text/javascript">
  39. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. /* @license-end */
  42. </script>
  43. <script type="text/javascript" src="menudata.js"></script>
  44. <script type="text/javascript" src="menu.js"></script>
  45. <script type="text/javascript">
  46. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  47. $(function() {
  48. initMenu('',true,false,'search.php','Search');
  49. $(document).ready(function() { init_search(); });
  50. });
  51. /* @license-end */</script>
  52. <div id="main-nav"></div>
  53. </div><!-- top -->
  54. <div id="side-nav" class="ui-resizable side-nav-resizable">
  55. <div id="nav-tree">
  56. <div id="nav-tree-contents">
  57. <div id="nav-sync" class="sync"></div>
  58. </div>
  59. </div>
  60. <div id="splitbar" style="-moz-user-select:none;"
  61. class="ui-resizable-handle">
  62. </div>
  63. </div>
  64. <script type="text/javascript">
  65. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  66. $(document).ready(function(){initNavTree('class_qwt_date.html',''); initResizable(); });
  67. /* @license-end */
  68. </script>
  69. <div id="doc-content">
  70. <!-- window showing the filter options -->
  71. <div id="MSearchSelectWindow"
  72. onmouseover="return searchBox.OnSearchSelectShow()"
  73. onmouseout="return searchBox.OnSearchSelectHide()"
  74. onkeydown="return searchBox.OnSearchSelectKey(event)">
  75. </div>
  76. <!-- iframe showing the search results (closed by default) -->
  77. <div id="MSearchResultsWindow">
  78. <iframe src="javascript:void(0)" frameborder="0"
  79. name="MSearchResults" id="MSearchResults">
  80. </iframe>
  81. </div>
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-types">Public Types</a> &#124;
  85. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  86. <a href="class_qwt_date-members.html">List of all members</a> </div>
  87. <div class="headertitle">
  88. <div class="title">QwtDate Class Reference</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <p>A collection of methods around date/time values.
  92. <a href="class_qwt_date.html#details">More...</a></p>
  93. <p><code>#include &lt;<a class="el" href="qwt__date_8h_source.html">qwt_date.h</a>&gt;</code></p>
  94. <table class="memberdecls">
  95. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  96. Public Types</h2></td></tr>
  97. <tr class="memitem:ab915db512c556a4666ada4fbfccfce1e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a> { <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1ea82971cd90d670fe3048ad8c377379c1d">FirstThursday</a>,
  98. <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1eab5c50b8108f8c4535201c0c590a598d6">FirstDay</a>
  99. }</td></tr>
  100. <tr class="separator:ab915db512c556a4666ada4fbfccfce1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:ad037b999a51cae4d9ab36bf8e7859587"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">IntervalType</a> { <br />
  102. &#160;&#160;<a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587a4e1d45d6382c27689a30adc11186d4f1">Millisecond</a>,
  103. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587aabaf7a7d45288a33590f61fe075b3590">Second</a>,
  104. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587a7c9073c66b2628adbe772ac4c1a678ef">Minute</a>,
  105. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587a8e7a2f91f89423e446bfdaa1e01ebd2f">Hour</a>,
  106. <br />
  107. &#160;&#160;<a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587a1d503616cab082a9c741be881cc0a813">Day</a>,
  108. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587ae204b4e8ce8679ba9ac378e41bd77b2b">Week</a>,
  109. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587a0ab43f35f1bdbae7536be2be0455700a">Month</a>,
  110. <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587ae306523ed94ccf930afb811ff7a735ab">Year</a>
  111. <br />
  112. }</td></tr>
  113. <tr class="separator:ad037b999a51cae4d9ab36bf8e7859587"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:af636fffdebea2e4463fc32461b1217e0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="class_qwt_date.html#af636fffdebea2e4463fc32461b1217e0aed8ee8f3dbc5b7a5e953b3ec51a79108">JulianDayForEpoch</a> = 2440588
  115. }</td></tr>
  116. <tr class="separator:af636fffdebea2e4463fc32461b1217e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. </table><table class="memberdecls">
  118. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
  119. Static Public Member Functions</h2></td></tr>
  120. <tr class="memitem:a9ab1845543957472c2c6529ad03ef98d"><td class="memItemLeft" align="right" valign="top">static QDate&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#a9ab1845543957472c2c6529ad03ef98d">minDate</a> ()</td></tr>
  121. <tr class="separator:a9ab1845543957472c2c6529ad03ef98d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  122. <tr class="memitem:af82ba26011550602f1adb61da53bd830"><td class="memItemLeft" align="right" valign="top">static QDate&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#af82ba26011550602f1adb61da53bd830">maxDate</a> ()</td></tr>
  123. <tr class="separator:af82ba26011550602f1adb61da53bd830"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:a8039dc115458981fc1c7fc2c0aa8d053"><td class="memItemLeft" align="right" valign="top">static QDateTime&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#a8039dc115458981fc1c7fc2c0aa8d053">toDateTime</a> (double value, Qt::TimeSpec=Qt::UTC)</td></tr>
  125. <tr class="separator:a8039dc115458981fc1c7fc2c0aa8d053"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:afce10fd70f7a1ecac3f97776fb2dc46a"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#afce10fd70f7a1ecac3f97776fb2dc46a">toDouble</a> (const QDateTime &amp;)</td></tr>
  127. <tr class="separator:afce10fd70f7a1ecac3f97776fb2dc46a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:ab4d7b043971e13a97a8b5f9edb5eee02"><td class="memItemLeft" align="right" valign="top">static QDateTime&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#ab4d7b043971e13a97a8b5f9edb5eee02">ceil</a> (const QDateTime &amp;, <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">IntervalType</a>)</td></tr>
  129. <tr class="separator:ab4d7b043971e13a97a8b5f9edb5eee02"><td class="memSeparator" colspan="2">&#160;</td></tr>
  130. <tr class="memitem:a1b350f22a57b44b529bc4de740dbe213"><td class="memItemLeft" align="right" valign="top">static QDateTime&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#a1b350f22a57b44b529bc4de740dbe213">floor</a> (const QDateTime &amp;, <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">IntervalType</a>)</td></tr>
  131. <tr class="separator:a1b350f22a57b44b529bc4de740dbe213"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:abb91fb441a254337d5445ad4bab1a662"><td class="memItemLeft" align="right" valign="top">static QDate&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#abb91fb441a254337d5445ad4bab1a662">dateOfWeek0</a> (int year, <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>)</td></tr>
  133. <tr class="memdesc:abb91fb441a254337d5445ad4bab1a662"><td class="mdescLeft">&#160;</td><td class="mdescRight">Date of the first day of the first week for a year. <a href="class_qwt_date.html#abb91fb441a254337d5445ad4bab1a662">More...</a><br /></td></tr>
  134. <tr class="separator:abb91fb441a254337d5445ad4bab1a662"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a90dd1f9dc38565c003f8e1ef821965b7"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#a90dd1f9dc38565c003f8e1ef821965b7">weekNumber</a> (const QDate &amp;, <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>)</td></tr>
  136. <tr class="separator:a90dd1f9dc38565c003f8e1ef821965b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:aeadce3496f631eae3a7e54749078c7a4"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#aeadce3496f631eae3a7e54749078c7a4">utcOffset</a> (const QDateTime &amp;)</td></tr>
  138. <tr class="separator:aeadce3496f631eae3a7e54749078c7a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a2c19998281321ba078d717f7f9ec6855"><td class="memItemLeft" align="right" valign="top">static QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_date.html#a2c19998281321ba078d717f7f9ec6855">toString</a> (const QDateTime &amp;, const QString &amp;format, <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>)</td></tr>
  140. <tr class="separator:a2c19998281321ba078d717f7f9ec6855"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. </table>
  142. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  143. <div class="textblock"><p>A collection of methods around date/time values. </p>
  144. <p>Qt offers convenient classes for dealing with date/time values, but Qwt uses coordinate systems that are based on doubles. <a class="el" href="class_qwt_date.html" title="A collection of methods around date/time values.">QwtDate</a> offers methods to translate from QDateTime to double and v.v.</p>
  145. <p>A double is interpreted as the number of milliseconds since 1970-01-01T00:00:00 Universal Coordinated Time - also known as "The Epoch".</p>
  146. <p>While the range of the Julian day in Qt4 is limited to [0, MAX_INT], Qt5 stores it as qint64 offering a huge range of valid dates. As the significance of a double is below this ( assuming a fraction of 52 bits ) the translation is not bijective with rounding errors for dates very far from Epoch. For a resolution of 1 ms those start to happen for dates above the year 144683.</p>
  147. <p>An axis for a date/time interval is expected to be aligned and divided in time/date units like seconds, minutes, ... <a class="el" href="class_qwt_date.html" title="A collection of methods around date/time values.">QwtDate</a> offers several algorithms that are needed to calculate these axes.</p>
  148. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date_scale_engine.html" title="A scale engine for date/time values.">QwtDateScaleEngine</a>, <a class="el" href="class_qwt_date_scale_draw.html" title="A class for drawing datetime scales.">QwtDateScaleDraw</a>, QDate, QTime </dd></dl>
  149. </div><h2 class="groupheader">Member Enumeration Documentation</h2>
  150. <a id="af636fffdebea2e4463fc32461b1217e0"></a>
  151. <h2 class="memtitle"><span class="permalink"><a href="#af636fffdebea2e4463fc32461b1217e0">&#9670;&nbsp;</a></span>anonymous enum</h2>
  152. <div class="memitem">
  153. <div class="memproto">
  154. <table class="memname">
  155. <tr>
  156. <td class="memname">anonymous enum</td>
  157. </tr>
  158. </table>
  159. </div><div class="memdoc">
  160. <table class="fieldtable">
  161. <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="af636fffdebea2e4463fc32461b1217e0aed8ee8f3dbc5b7a5e953b3ec51a79108"></a>JulianDayForEpoch&#160;</td><td class="fielddoc"><p>The Julian day of "The Epoch". </p>
  162. </td></tr>
  163. </table>
  164. </div>
  165. </div>
  166. <a id="ad037b999a51cae4d9ab36bf8e7859587"></a>
  167. <h2 class="memtitle"><span class="permalink"><a href="#ad037b999a51cae4d9ab36bf8e7859587">&#9670;&nbsp;</a></span>IntervalType</h2>
  168. <div class="memitem">
  169. <div class="memproto">
  170. <table class="memname">
  171. <tr>
  172. <td class="memname">enum <a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">QwtDate::IntervalType</a></td>
  173. </tr>
  174. </table>
  175. </div><div class="memdoc">
  176. <p>Classification of an time interval</p>
  177. <p>Time intervals needs to be classified to decide how to align and divide it. </p>
  178. <table class="fieldtable">
  179. <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587a4e1d45d6382c27689a30adc11186d4f1"></a>Millisecond&#160;</td><td class="fielddoc"><p>The interval is related to milliseconds. </p>
  180. </td></tr>
  181. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587aabaf7a7d45288a33590f61fe075b3590"></a>Second&#160;</td><td class="fielddoc"><p>The interval is related to seconds. </p>
  182. </td></tr>
  183. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587a7c9073c66b2628adbe772ac4c1a678ef"></a>Minute&#160;</td><td class="fielddoc"><p>The interval is related to minutes. </p>
  184. </td></tr>
  185. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587a8e7a2f91f89423e446bfdaa1e01ebd2f"></a>Hour&#160;</td><td class="fielddoc"><p>The interval is related to hours. </p>
  186. </td></tr>
  187. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587a1d503616cab082a9c741be881cc0a813"></a>Day&#160;</td><td class="fielddoc"><p>The interval is related to days. </p>
  188. </td></tr>
  189. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587ae204b4e8ce8679ba9ac378e41bd77b2b"></a>Week&#160;</td><td class="fielddoc"><p>The interval is related to weeks. </p>
  190. </td></tr>
  191. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587a0ab43f35f1bdbae7536be2be0455700a"></a>Month&#160;</td><td class="fielddoc"><p>The interval is related to months. </p>
  192. </td></tr>
  193. <tr><td class="fieldname"><a id="ad037b999a51cae4d9ab36bf8e7859587ae306523ed94ccf930afb811ff7a735ab"></a>Year&#160;</td><td class="fielddoc"><p>The interval is related to years. </p>
  194. </td></tr>
  195. </table>
  196. </div>
  197. </div>
  198. <a id="ab915db512c556a4666ada4fbfccfce1e"></a>
  199. <h2 class="memtitle"><span class="permalink"><a href="#ab915db512c556a4666ada4fbfccfce1e">&#9670;&nbsp;</a></span>Week0Type</h2>
  200. <div class="memitem">
  201. <div class="memproto">
  202. <table class="memname">
  203. <tr>
  204. <td class="memname">enum <a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">QwtDate::Week0Type</a></td>
  205. </tr>
  206. </table>
  207. </div><div class="memdoc">
  208. <p>How to identify the first week of year differs between countries. </p>
  209. <table class="fieldtable">
  210. <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ab915db512c556a4666ada4fbfccfce1ea82971cd90d670fe3048ad8c377379c1d"></a>FirstThursday&#160;</td><td class="fielddoc"><p>According to ISO 8601 the first week of a year is defined as "the week with the year's first Thursday in it".</p>
  211. <p>FirstThursday corresponds to the numbering that is implemented in QDate::weekNumber(). </p>
  212. </td></tr>
  213. <tr><td class="fieldname"><a id="ab915db512c556a4666ada4fbfccfce1eab5c50b8108f8c4535201c0c590a598d6"></a>FirstDay&#160;</td><td class="fielddoc"><p>"The week with January 1.1 in it."</p>
  214. <p>In the U.S. this definition is more common than FirstThursday. </p>
  215. </td></tr>
  216. </table>
  217. </div>
  218. </div>
  219. <h2 class="groupheader">Member Function Documentation</h2>
  220. <a id="ab4d7b043971e13a97a8b5f9edb5eee02"></a>
  221. <h2 class="memtitle"><span class="permalink"><a href="#ab4d7b043971e13a97a8b5f9edb5eee02">&#9670;&nbsp;</a></span>ceil()</h2>
  222. <div class="memitem">
  223. <div class="memproto">
  224. <table class="mlabels">
  225. <tr>
  226. <td class="mlabels-left">
  227. <table class="memname">
  228. <tr>
  229. <td class="memname">QDateTime QwtDate::ceil </td>
  230. <td>(</td>
  231. <td class="paramtype">const QDateTime &amp;&#160;</td>
  232. <td class="paramname"><em>dateTime</em>, </td>
  233. </tr>
  234. <tr>
  235. <td class="paramkey"></td>
  236. <td></td>
  237. <td class="paramtype"><a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">IntervalType</a>&#160;</td>
  238. <td class="paramname"><em>intervalType</em>&#160;</td>
  239. </tr>
  240. <tr>
  241. <td></td>
  242. <td>)</td>
  243. <td></td><td></td>
  244. </tr>
  245. </table>
  246. </td>
  247. <td class="mlabels-right">
  248. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  249. </tr>
  250. </table>
  251. </div><div class="memdoc">
  252. <p>Ceil a datetime according the interval type</p>
  253. <dl class="params"><dt>Parameters</dt><dd>
  254. <table class="params">
  255. <tr><td class="paramname">dateTime</td><td>Datetime value </td></tr>
  256. <tr><td class="paramname">intervalType</td><td>Interval type, how to ceil. F.e. when intervalType = QwtDate::Months, the result will be ceiled to the next beginning of a month </td></tr>
  257. </table>
  258. </dd>
  259. </dl>
  260. <dl class="section return"><dt>Returns</dt><dd>Ceiled datetime </dd></dl>
  261. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#a1b350f22a57b44b529bc4de740dbe213">floor()</a> </dd></dl>
  262. </div>
  263. </div>
  264. <a id="abb91fb441a254337d5445ad4bab1a662"></a>
  265. <h2 class="memtitle"><span class="permalink"><a href="#abb91fb441a254337d5445ad4bab1a662">&#9670;&nbsp;</a></span>dateOfWeek0()</h2>
  266. <div class="memitem">
  267. <div class="memproto">
  268. <table class="mlabels">
  269. <tr>
  270. <td class="mlabels-left">
  271. <table class="memname">
  272. <tr>
  273. <td class="memname">QDate QwtDate::dateOfWeek0 </td>
  274. <td>(</td>
  275. <td class="paramtype">int&#160;</td>
  276. <td class="paramname"><em>year</em>, </td>
  277. </tr>
  278. <tr>
  279. <td class="paramkey"></td>
  280. <td></td>
  281. <td class="paramtype"><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>&#160;</td>
  282. <td class="paramname"><em>type</em>&#160;</td>
  283. </tr>
  284. <tr>
  285. <td></td>
  286. <td>)</td>
  287. <td></td><td></td>
  288. </tr>
  289. </table>
  290. </td>
  291. <td class="mlabels-right">
  292. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  293. </tr>
  294. </table>
  295. </div><div class="memdoc">
  296. <p>Date of the first day of the first week for a year. </p>
  297. <p>The first day of a week depends on the current locale ( QLocale::firstDayOfWeek() ).</p>
  298. <dl class="params"><dt>Parameters</dt><dd>
  299. <table class="params">
  300. <tr><td class="paramname">year</td><td>Year </td></tr>
  301. <tr><td class="paramname">type</td><td>Option how to identify the first week </td></tr>
  302. </table>
  303. </dd>
  304. </dl>
  305. <dl class="section return"><dt>Returns</dt><dd>First day of week 0</dd></dl>
  306. <dl class="section see"><dt>See also</dt><dd>QLocale::firstDayOfWeek(), <a class="el" href="class_qwt_date.html#a90dd1f9dc38565c003f8e1ef821965b7">weekNumber()</a> </dd></dl>
  307. </div>
  308. </div>
  309. <a id="a1b350f22a57b44b529bc4de740dbe213"></a>
  310. <h2 class="memtitle"><span class="permalink"><a href="#a1b350f22a57b44b529bc4de740dbe213">&#9670;&nbsp;</a></span>floor()</h2>
  311. <div class="memitem">
  312. <div class="memproto">
  313. <table class="mlabels">
  314. <tr>
  315. <td class="mlabels-left">
  316. <table class="memname">
  317. <tr>
  318. <td class="memname">QDateTime QwtDate::floor </td>
  319. <td>(</td>
  320. <td class="paramtype">const QDateTime &amp;&#160;</td>
  321. <td class="paramname"><em>dateTime</em>, </td>
  322. </tr>
  323. <tr>
  324. <td class="paramkey"></td>
  325. <td></td>
  326. <td class="paramtype"><a class="el" href="class_qwt_date.html#ad037b999a51cae4d9ab36bf8e7859587">IntervalType</a>&#160;</td>
  327. <td class="paramname"><em>intervalType</em>&#160;</td>
  328. </tr>
  329. <tr>
  330. <td></td>
  331. <td>)</td>
  332. <td></td><td></td>
  333. </tr>
  334. </table>
  335. </td>
  336. <td class="mlabels-right">
  337. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  338. </tr>
  339. </table>
  340. </div><div class="memdoc">
  341. <p>Floor a datetime according the interval type</p>
  342. <dl class="params"><dt>Parameters</dt><dd>
  343. <table class="params">
  344. <tr><td class="paramname">dateTime</td><td>Datetime value </td></tr>
  345. <tr><td class="paramname">intervalType</td><td>Interval type, how to ceil. F.e. when intervalType = QwtDate::Months, the result will be ceiled to the next beginning of a month </td></tr>
  346. </table>
  347. </dd>
  348. </dl>
  349. <dl class="section return"><dt>Returns</dt><dd>Floored datetime </dd></dl>
  350. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#a1b350f22a57b44b529bc4de740dbe213">floor()</a> </dd></dl>
  351. </div>
  352. </div>
  353. <a id="af82ba26011550602f1adb61da53bd830"></a>
  354. <h2 class="memtitle"><span class="permalink"><a href="#af82ba26011550602f1adb61da53bd830">&#9670;&nbsp;</a></span>maxDate()</h2>
  355. <div class="memitem">
  356. <div class="memproto">
  357. <table class="mlabels">
  358. <tr>
  359. <td class="mlabels-left">
  360. <table class="memname">
  361. <tr>
  362. <td class="memname">QDate QwtDate::maxDate </td>
  363. <td>(</td>
  364. <td class="paramname"></td><td>)</td>
  365. <td></td>
  366. </tr>
  367. </table>
  368. </td>
  369. <td class="mlabels-right">
  370. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  371. </tr>
  372. </table>
  373. </div><div class="memdoc">
  374. <p>Maximum for the supported date range</p>
  375. <p>The range of valid dates depends on how QDate stores the Julian day internally.</p>
  376. <ul>
  377. <li>For Qt4 it is "Tue Jun 3 5874898"</li>
  378. <li>For Qt5 it is "Tue Dec 31 2147483647"</li>
  379. </ul>
  380. <dl class="section return"><dt>Returns</dt><dd>maximum of the date range </dd></dl>
  381. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#a9ab1845543957472c2c6529ad03ef98d">minDate()</a> </dd></dl>
  382. <dl class="section note"><dt>Note</dt><dd>The maximum differs between Qt4 and Qt5 </dd></dl>
  383. </div>
  384. </div>
  385. <a id="a9ab1845543957472c2c6529ad03ef98d"></a>
  386. <h2 class="memtitle"><span class="permalink"><a href="#a9ab1845543957472c2c6529ad03ef98d">&#9670;&nbsp;</a></span>minDate()</h2>
  387. <div class="memitem">
  388. <div class="memproto">
  389. <table class="mlabels">
  390. <tr>
  391. <td class="mlabels-left">
  392. <table class="memname">
  393. <tr>
  394. <td class="memname">QDate QwtDate::minDate </td>
  395. <td>(</td>
  396. <td class="paramname"></td><td>)</td>
  397. <td></td>
  398. </tr>
  399. </table>
  400. </td>
  401. <td class="mlabels-right">
  402. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  403. </tr>
  404. </table>
  405. </div><div class="memdoc">
  406. <p>Minimum for the supported date range</p>
  407. <p>The range of valid dates depends on how QDate stores the Julian day internally.</p>
  408. <ul>
  409. <li>For Qt4 it is "Tue Jan 2 -4713"</li>
  410. <li>For Qt5 it is "Thu Jan 1 -2147483648"</li>
  411. </ul>
  412. <dl class="section return"><dt>Returns</dt><dd>minimum of the date range </dd></dl>
  413. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#af82ba26011550602f1adb61da53bd830">maxDate()</a> </dd></dl>
  414. </div>
  415. </div>
  416. <a id="a8039dc115458981fc1c7fc2c0aa8d053"></a>
  417. <h2 class="memtitle"><span class="permalink"><a href="#a8039dc115458981fc1c7fc2c0aa8d053">&#9670;&nbsp;</a></span>toDateTime()</h2>
  418. <div class="memitem">
  419. <div class="memproto">
  420. <table class="mlabels">
  421. <tr>
  422. <td class="mlabels-left">
  423. <table class="memname">
  424. <tr>
  425. <td class="memname">QDateTime QwtDate::toDateTime </td>
  426. <td>(</td>
  427. <td class="paramtype">double&#160;</td>
  428. <td class="paramname"><em>value</em>, </td>
  429. </tr>
  430. <tr>
  431. <td class="paramkey"></td>
  432. <td></td>
  433. <td class="paramtype">Qt::TimeSpec&#160;</td>
  434. <td class="paramname"><em>timeSpec</em> = <code>Qt::UTC</code>&#160;</td>
  435. </tr>
  436. <tr>
  437. <td></td>
  438. <td>)</td>
  439. <td></td><td></td>
  440. </tr>
  441. </table>
  442. </td>
  443. <td class="mlabels-right">
  444. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  445. </tr>
  446. </table>
  447. </div><div class="memdoc">
  448. <p>Translate from double to QDateTime</p>
  449. <dl class="params"><dt>Parameters</dt><dd>
  450. <table class="params">
  451. <tr><td class="paramname">value</td><td>Number of milliseconds since the epoch, 1970-01-01T00:00:00 UTC </td></tr>
  452. <tr><td class="paramname">timeSpec</td><td>Time specification </td></tr>
  453. </table>
  454. </dd>
  455. </dl>
  456. <dl class="section return"><dt>Returns</dt><dd>Datetime value</dd></dl>
  457. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#afce10fd70f7a1ecac3f97776fb2dc46a">toDouble()</a>, QDateTime::setMSecsSinceEpoch() </dd></dl>
  458. <dl class="section note"><dt>Note</dt><dd>The return datetime for Qt::OffsetFromUTC will be Qt::UTC </dd></dl>
  459. </div>
  460. </div>
  461. <a id="afce10fd70f7a1ecac3f97776fb2dc46a"></a>
  462. <h2 class="memtitle"><span class="permalink"><a href="#afce10fd70f7a1ecac3f97776fb2dc46a">&#9670;&nbsp;</a></span>toDouble()</h2>
  463. <div class="memitem">
  464. <div class="memproto">
  465. <table class="mlabels">
  466. <tr>
  467. <td class="mlabels-left">
  468. <table class="memname">
  469. <tr>
  470. <td class="memname">double QwtDate::toDouble </td>
  471. <td>(</td>
  472. <td class="paramtype">const QDateTime &amp;&#160;</td>
  473. <td class="paramname"><em>dateTime</em></td><td>)</td>
  474. <td></td>
  475. </tr>
  476. </table>
  477. </td>
  478. <td class="mlabels-right">
  479. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  480. </tr>
  481. </table>
  482. </div><div class="memdoc">
  483. <p>Translate from QDateTime to double</p>
  484. <dl class="params"><dt>Parameters</dt><dd>
  485. <table class="params">
  486. <tr><td class="paramname">dateTime</td><td>Datetime value </td></tr>
  487. </table>
  488. </dd>
  489. </dl>
  490. <dl class="section return"><dt>Returns</dt><dd>Number of milliseconds since 1970-01-01T00:00:00 UTC has passed.</dd></dl>
  491. <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_date.html#a8039dc115458981fc1c7fc2c0aa8d053">toDateTime()</a>, QDateTime::toMSecsSinceEpoch() </dd></dl>
  492. <dl class="section warning"><dt>Warning</dt><dd>For values very far below or above 1970-01-01 UTC rounding errors will happen due to the limited significance of a double. </dd></dl>
  493. </div>
  494. </div>
  495. <a id="a2c19998281321ba078d717f7f9ec6855"></a>
  496. <h2 class="memtitle"><span class="permalink"><a href="#a2c19998281321ba078d717f7f9ec6855">&#9670;&nbsp;</a></span>toString()</h2>
  497. <div class="memitem">
  498. <div class="memproto">
  499. <table class="mlabels">
  500. <tr>
  501. <td class="mlabels-left">
  502. <table class="memname">
  503. <tr>
  504. <td class="memname">QString QwtDate::toString </td>
  505. <td>(</td>
  506. <td class="paramtype">const QDateTime &amp;&#160;</td>
  507. <td class="paramname"><em>dateTime</em>, </td>
  508. </tr>
  509. <tr>
  510. <td class="paramkey"></td>
  511. <td></td>
  512. <td class="paramtype">const QString &amp;&#160;</td>
  513. <td class="paramname"><em>format</em>, </td>
  514. </tr>
  515. <tr>
  516. <td class="paramkey"></td>
  517. <td></td>
  518. <td class="paramtype"><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>&#160;</td>
  519. <td class="paramname"><em>week0Type</em>&#160;</td>
  520. </tr>
  521. <tr>
  522. <td></td>
  523. <td>)</td>
  524. <td></td><td></td>
  525. </tr>
  526. </table>
  527. </td>
  528. <td class="mlabels-right">
  529. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  530. </tr>
  531. </table>
  532. </div><div class="memdoc">
  533. <p>Translate a datetime into a string</p>
  534. <p>Beside the format expressions documented in QDateTime::toString() the following expressions are supported:</p>
  535. <ul>
  536. <li>w<br />
  537. week number: ( 1 - 53 )</li>
  538. <li>ww<br />
  539. week number with a leading zero ( 01 - 53 )</li>
  540. </ul>
  541. <p>As week 1 usually starts in the previous year a special rule is applied for formats, where the year is expected to match the week number - even if the date belongs to the previous year.</p>
  542. <dl class="params"><dt>Parameters</dt><dd>
  543. <table class="params">
  544. <tr><td class="paramname">dateTime</td><td>Datetime value </td></tr>
  545. <tr><td class="paramname">format</td><td>Format string </td></tr>
  546. <tr><td class="paramname">week0Type</td><td>Specification of week 0</td></tr>
  547. </table>
  548. </dd>
  549. </dl>
  550. <dl class="section return"><dt>Returns</dt><dd>Datetime string </dd></dl>
  551. <dl class="section see"><dt>See also</dt><dd>QDateTime::toString(), <a class="el" href="class_qwt_date.html#a90dd1f9dc38565c003f8e1ef821965b7">weekNumber()</a>, <a class="el" href="class_qwt_date_scale_draw.html" title="A class for drawing datetime scales.">QwtDateScaleDraw</a> </dd></dl>
  552. </div>
  553. </div>
  554. <a id="aeadce3496f631eae3a7e54749078c7a4"></a>
  555. <h2 class="memtitle"><span class="permalink"><a href="#aeadce3496f631eae3a7e54749078c7a4">&#9670;&nbsp;</a></span>utcOffset()</h2>
  556. <div class="memitem">
  557. <div class="memproto">
  558. <table class="mlabels">
  559. <tr>
  560. <td class="mlabels-left">
  561. <table class="memname">
  562. <tr>
  563. <td class="memname">int QwtDate::utcOffset </td>
  564. <td>(</td>
  565. <td class="paramtype">const QDateTime &amp;&#160;</td>
  566. <td class="paramname"><em>dateTime</em></td><td>)</td>
  567. <td></td>
  568. </tr>
  569. </table>
  570. </td>
  571. <td class="mlabels-right">
  572. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  573. </tr>
  574. </table>
  575. </div><div class="memdoc">
  576. <p>Offset in seconds from Coordinated Universal Time</p>
  577. <p>The offset depends on the time specification of dateTime:</p>
  578. <ul>
  579. <li>Qt::UTC 0, dateTime has no offset</li>
  580. <li>Qt::OffsetFromUTC returns dateTime.utcOffset()</li>
  581. <li>Qt::LocalTime: number of seconds from the UTC</li>
  582. </ul>
  583. <p>For Qt::LocalTime the offset depends on the timezone and daylight savings.</p>
  584. <dl class="params"><dt>Parameters</dt><dd>
  585. <table class="params">
  586. <tr><td class="paramname">dateTime</td><td>Datetime value </td></tr>
  587. </table>
  588. </dd>
  589. </dl>
  590. <dl class="section return"><dt>Returns</dt><dd>Offset in seconds </dd></dl>
  591. </div>
  592. </div>
  593. <a id="a90dd1f9dc38565c003f8e1ef821965b7"></a>
  594. <h2 class="memtitle"><span class="permalink"><a href="#a90dd1f9dc38565c003f8e1ef821965b7">&#9670;&nbsp;</a></span>weekNumber()</h2>
  595. <div class="memitem">
  596. <div class="memproto">
  597. <table class="mlabels">
  598. <tr>
  599. <td class="mlabels-left">
  600. <table class="memname">
  601. <tr>
  602. <td class="memname">int QwtDate::weekNumber </td>
  603. <td>(</td>
  604. <td class="paramtype">const QDate &amp;&#160;</td>
  605. <td class="paramname"><em>date</em>, </td>
  606. </tr>
  607. <tr>
  608. <td class="paramkey"></td>
  609. <td></td>
  610. <td class="paramtype"><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1e">Week0Type</a>&#160;</td>
  611. <td class="paramname"><em>type</em>&#160;</td>
  612. </tr>
  613. <tr>
  614. <td></td>
  615. <td>)</td>
  616. <td></td><td></td>
  617. </tr>
  618. </table>
  619. </td>
  620. <td class="mlabels-right">
  621. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  622. </tr>
  623. </table>
  624. </div><div class="memdoc">
  625. <p>Find the week number of a date</p>
  626. <ul>
  627. <li><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1ea82971cd90d670fe3048ad8c377379c1d">QwtDate::FirstThursday</a><br />
  628. Corresponding to ISO 8601 ( see QDate::weekNumber() ).</li>
  629. <li><a class="el" href="class_qwt_date.html#ab915db512c556a4666ada4fbfccfce1eab5c50b8108f8c4535201c0c590a598d6">QwtDate::FirstDay</a><br />
  630. Number of weeks that have begun since <a class="el" href="class_qwt_date.html#abb91fb441a254337d5445ad4bab1a662" title="Date of the first day of the first week for a year.">dateOfWeek0()</a>.</li>
  631. </ul>
  632. <dl class="params"><dt>Parameters</dt><dd>
  633. <table class="params">
  634. <tr><td class="paramname">date</td><td>Date </td></tr>
  635. <tr><td class="paramname">type</td><td>Option how to identify the first week</td></tr>
  636. </table>
  637. </dd>
  638. </dl>
  639. <dl class="section return"><dt>Returns</dt><dd>Week number, starting with 1 </dd></dl>
  640. </div>
  641. </div>
  642. </div><!-- contents -->
  643. </div><!-- doc-content -->
  644. <!-- start footer part -->
  645. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  646. <ul>
  647. <li class="navelem"><a class="el" href="class_qwt_date.html">QwtDate</a></li>
  648. <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  649. </ul>
  650. </div>
  651. </body>
  652. </html>