public getTimestamp ( ) : integer | ||
return | integer |
public function getTimestamp()
{
return hexdec(substr((string) $this->objectID, 0, 8));
}
public function testCreateWithString() { $original = '54203e08d51d4a1f868b456e'; $id = new \MongoId($original); $this->assertSame($original, (string) $id); $this->assertSame(9127278, $id->getInc()); $this->assertSame(1411399176, $id->getTimestamp()); $this->assertSame(34335, $id->getPID()); }