MongoId::getTimestamp

(PECL mongo >= 1.0.1)

MongoId::getTimestampGets the number of seconds since the epoch that this id was created

Description

public int MongoId::getTimestamp ( void )

This returns the same thing as running time() when the id is created.

Parameters

This function has no parameters.

Return Values

Returns the number of seconds since the epoch that this id was created. There are only four bytes of timestamp stored, so MongoDate is a better choice for storing exact or wide-ranging times.

Коментарии

Автор:
There is no equivalent for this method in the new extension, so instead use…

<?php
$id 
= new MongoDBBSONObjectID('42cf58a2e1c5ede216cb7f05');
$timestamp hexdec(substr($id08));
?>
2016-07-14 17:37:20
http://php5.kiev.ua/manual/ru/mongoid.gettimestamp.html

    Поддержать сайт на родительском проекте КГБ