MongoTimestamp::__construct

(PECL mongo >= 1.0.1)

MongoTimestamp::__construct创建一个新的时间戳。

说明

public MongoTimestamp::__construct ([ int $sec = time() [, int $inc ]] )

创建一个新的时间戳。如果没有指定参数,将使用当前的时间戳,也会自动提供增量。 模块加载时增量设置为 0,并且在每次调用构造器时自动增加(没有传入 $inc 参数时)。

参数

sec

自纪元时间以来的秒数(比如 1 Jan 1970 00:00:00.000 UTC)。

inc

增量。

返回值

返回新的 timestamp。

参见