<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns the timestamp component of this Timestamp</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongodb-bson-timestamp.getincrement.html">MongoDB\BSON\Timestamp::getIncrement</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongodb-bson-timestamp.jsonserialize.html">MongoDB\BSON\Timestamp::jsonSerialize</a></div> <div class="up"><a href="class.mongodb-bson-timestamp.html">MongoDB\BSON\Timestamp</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mongodb-bson-timestamp.gettimestamp" class="refentry"> <div class="refnamediv"> <h1 class="refname">MongoDB\BSON\Timestamp::getTimestamp</h1> <p class="verinfo">(mongodb >=1.3.0)</p><p class="refpurpose"><span class="refname">MongoDB\BSON\Timestamp::getTimestamp</span> — <span class="dc-title">Returns the timestamp component of this Timestamp</span></p> </div> <div class="refsect1 description" id="refsect1-mongodb-bson-timestamp.gettimestamp-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>MongoDB\BSON\Timestamp::getTimestamp</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> The timestamp component of a Timestamp is its most significant 32 bits, which denotes the number of seconds since the Unix epoch. This value is read as an unsigned 32-bit integer with big-endian byte order. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> Because PHP's integer type is signed, some values returned by this method may appear as negative integers on 32-bit platforms. The <em>"%u"</em> formatter of <span class="function"><a href="function.sprintf.html" class="function">sprintf()</a></span> may be used to obtain a string representation of the unsigned decimal value. </span> </p></blockquote> </div> <div class="refsect1 parameters" id="refsect1-mongodb-bson-timestamp.gettimestamp-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-mongodb-bson-timestamp.gettimestamp-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the timestamp component of this Timestamp. </p> <div class="warning"><strong class="warning">Warning</strong> <p class="simpara"> On 32-bit systems this method may return a negative number. Although the increment and timestamp parts of the BSON timestamp type consists of two unsigned 32-bit values, PHP can not represent these on 32-bit platforms. </p> </div> </div> <div class="refsect1 errors" id="refsect1-mongodb-bson-timestamp.gettimestamp-errors"> <h3 class="title">Errors/Exceptions</h3> <ul class="simplelist"> <li class="member">Throws <a href="class.mongodb-driver-exception-invalidargumentexception.html" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a> on argument parsing errors.</li> </ul> </div> <div class="refsect1 seealso" id="refsect1-mongodb-bson-timestamp.gettimestamp-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"><a href="https://docs.mongodb.com/manual/reference/bson-types/#timestamps" class="link external">» BSON Types: Timestamps</a></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mongodb-bson-timestamp.getincrement.html">MongoDB\BSON\Timestamp::getIncrement</a></div> <div class="next" style="text-align: right; float: right;"><a href="mongodb-bson-timestamp.jsonserialize.html">MongoDB\BSON\Timestamp::jsonSerialize</a></div> <div class="up"><a href="class.mongodb-bson-timestamp.html">MongoDB\BSON\Timestamp</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>