1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Timestamp</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="symbol">class Timestamp</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> DateTime<br />
<b>Header:</b> Poco/Timestamp.h</p>
<h2>Description</h2>
<div class="description">
<p>A <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> stores a monotonic* time value with (theoretical) microseconds resolution. Timestamps can be compared with each other and simple arithmetics are supported. </p>
<p>[*] Note that <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> values are only monotonic as long as the systems's clock is monotonic as well (and not, e.g. set back). </p>
<p>Timestamps are UTC (Coordinated Universal Time) based and thus independent of the timezone in effect on the system. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Timestamp.html#11190" title="Poco::Timestamp::elapsed()">elapsed</a>, <a href="Poco.Timestamp.html#11189" title="Poco::Timestamp::epochMicroseconds()">epochMicroseconds</a>, <a href="Poco.Timestamp.html#11187" title="Poco::Timestamp::epochTime()">epochTime</a>, <a href="Poco.Timestamp.html#11193" title="Poco::Timestamp::fromEpochTime()">fromEpochTime</a>, <a href="Poco.Timestamp.html#11195" title="Poco::Timestamp::fromUtcTime()">fromUtcTime</a>, <a href="Poco.Timestamp.html#11191" title="Poco::Timestamp::isElapsed()">isElapsed</a>, <a href="Poco.Timestamp.html#11167" title="Poco::Timestamp::operator !=()">operator !=</a>, <a href="Poco.Timestamp.html#11177" title="Poco::Timestamp::operator +()">operator +</a>, <a href="Poco.Timestamp.html#11183" title="Poco::Timestamp::operator +=()">operator +=</a>, <a href="Poco.Timestamp.html#11179" title="Poco::Timestamp::operator -()">operator -</a>, <a href="Poco.Timestamp.html#11185" title="Poco::Timestamp::operator -=()">operator -=</a>, <a href="Poco.Timestamp.html#11173" title="Poco::Timestamp::operator <()">operator <</a>, <a href="Poco.Timestamp.html#11175" title="Poco::Timestamp::operator <=()">operator <=</a>, <a href="Poco.Timestamp.html#11158" title="Poco::Timestamp::operator =()">operator =</a>, <a href="Poco.Timestamp.html#11165" title="Poco::Timestamp::operator ==()">operator ==</a>, <a href="Poco.Timestamp.html#11169" title="Poco::Timestamp::operator >()">operator ></a>, <a href="Poco.Timestamp.html#11171" title="Poco::Timestamp::operator >=()">operator >=</a>, <a href="Poco.Timestamp.html#11197" title="Poco::Timestamp::resolution()">resolution</a>, <a href="Poco.Timestamp.html#11162" title="Poco::Timestamp::swap()">swap</a>, <a href="Poco.Timestamp.html#11164" title="Poco::Timestamp::update()">update</a>, <a href="Poco.Timestamp.html#11188" title="Poco::Timestamp::utcTime()">utcTime</a></p>
<h2>Types</h2>
<h3><a name="11151">TimeDiff</a></h3>
<p class="decl">typedef <a href="Poco.html#11357" title="Poco::Int64">Int64</a> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a>;</p>
<div class="description">
<p>difference between two timestamps in microseconds </p>
</div>
<h3><a name="11149">TimeVal</a></h3>
<p class="decl">typedef <a href="Poco.html#11357" title="Poco::Int64">Int64</a> <a href="Poco.Timestamp.html#11149" title="Poco::Timestamp::TimeVal">TimeVal</a>;</p>
<div class="description">
<p>monotonic UTC time value in microsecond resolution </p>
</div>
<h3><a name="11150">UtcTimeVal</a></h3>
<p class="decl">typedef <a href="Poco.html#11357" title="Poco::Int64">Int64</a> <a href="Poco.Timestamp.html#11150" title="Poco::Timestamp::UtcTimeVal">UtcTimeVal</a>;</p>
<div class="description">
<p>monotonic UTC time value in 100 nanosecond resolution </p>
</div>
<h2>Constructors</h2>
<h3><a name="11152">Timestamp</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>();</p>
<div class="description">
<p>Creates a timestamp with the current time. </p>
</div>
<h3><a name="11153">Timestamp</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>(<br /> <a href="Poco.Timestamp.html#11149" title="Poco::Timestamp::TimeVal">TimeVal</a> tv<br />);</p>
<div class="description">
<p>Creates a timestamp from the given time value. </p>
</div>
<h3><a name="11155">Timestamp</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>(<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & other<br />);</p>
<div class="description">
<p>Copy constructor. </p>
</div>
<h2>Destructor</h2>
<h3><a name="11157">~Timestamp</a></h3>
<p class="decl">~<a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>();</p>
<div class="description">
<p>Destroys the timestamp </p>
</div>
<h2>Member Functions</h2>
<h3><a name="11190">elapsed</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> elapsed() const;</p>
<div class="description">
<p>Returns the time elapsed since the time denoted by the timestamp. Equivalent to <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a>() - *this. </p>
</div>
<h3><a name="11189">epochMicroseconds</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html#11149" title="Poco::Timestamp::TimeVal">TimeVal</a> epochMicroseconds() const;</p>
<div class="description">
<p>Returns the timestamp expressed in microseconds since the Unix epoch, midnight, January 1, 1970. </p>
</div>
<h3><a name="11187">epochTime</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::time_t epochTime() const;</p>
<div class="description">
<p>Returns the timestamp expressed in time_t. time_t base time is midnight, January 1, 1970. Resolution is one second. </p>
</div>
<h3><a name="11193">fromEpochTime</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> fromEpochTime(<br /> std::time_t t<br />);</p>
<div class="description">
<p>Creates a timestamp from a std::time_t. </p>
</div>
<h3><a name="11195">fromUtcTime</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> fromUtcTime(<br /> <a href="Poco.Timestamp.html#11150" title="Poco::Timestamp::UtcTimeVal">UtcTimeVal</a> val<br />);</p>
<div class="description">
<p>Creates a timestamp from a UTC time value. </p>
</div>
<h3><a name="11191">isElapsed</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool isElapsed(<br /> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> interval<br />) const;</p>
<div class="description">
<p>Returns true if and only if the given interval has passed since the time denoted by the timestamp. </p>
</div>
<h3><a name="11167">operator !=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator != (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11177">operator +</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> operator + (<br /> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> d<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11183">operator +=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & operator += (<br /> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> d<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="11179">operator -</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> operator - (<br /> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> d<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11181">operator -</a></h3>
<p class="decl"><a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> operator - (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11185">operator -=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & operator -= (<br /> <a href="Poco.Timestamp.html#11151" title="Poco::Timestamp::TimeDiff">TimeDiff</a> d<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="11173">operator <</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator < (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11175">operator <=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator <= (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11158">operator =</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & operator = (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & other<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="11160">operator =</a></h3>
<p class="decl"><a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & operator = (<br /> <a href="Poco.Timestamp.html#11149" title="Poco::Timestamp::TimeVal">TimeVal</a> tv<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="11165">operator ==</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator == (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11169">operator ></a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator > (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11171">operator >=</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool operator >= (<br /> const <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & ts<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="11197">resolution</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static <a href="Poco.Timestamp.html#11149" title="Poco::Timestamp::TimeVal">TimeVal</a> resolution();</p>
<div class="description">
<p>Returns the resolution in units per second. Since the timestamp has microsecond resolution, the returned value is always 1000000. </p>
</div>
<h3><a name="11162">swap</a></h3>
<p class="decl">void swap(<br /> <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> & timestamp<br />);</p>
<div class="description">
<p>Swaps the <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> with another one. </p>
</div>
<h3><a name="11164">update</a></h3>
<p class="decl">void update();</p>
<div class="description">
<p>Updates the <a href="Poco.Timestamp.html" title="class Poco::Timestamp">Timestamp</a> with the current time. </p>
</div>
<h3><a name="11188">utcTime</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Timestamp.html#11150" title="Poco::Timestamp::UtcTimeVal">UtcTimeVal</a> utcTime() const;</p>
<div class="description">
<p>Returns the timestamp expressed in UTC-based time. UTC base time is midnight, October 15, 1582. Resolution is 100 nanoseconds. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|