Please wait while we load your page...
 

Announcements

PHP Manual :: MongoDB\BSON\UTCDateTime::__construct



MongoDB\BSON\UTCDateTime || MongoDB\BSON\UTCDateTime::toDateTime || PHP Manual

(mongodb >=1.0.0)

MongoDB\BSON\UTCDateTime::__constructConstruct a new UTCDateTime

Description

final public MongoDB\BSON\UTCDateTime::__construct ( integer $milliseconds )

Parameters

milliseconds (integer)

64-bit integer that represents the number of milliseconds since the Unix epoch (Jan 1, 1970). Negative values represent dates before 1970.

On 32-bit systems, this parameter may be provided as a string.

Errors/Exceptions

Examples

Example #1 MongoDB\BSON\UTCDateTime::__construct() example

<?php

$utcdatetime 
= new MongoDB\BSON\UTCDateTime(1416445411987);
var_dump($utcdatetime);

?>

The above example will output something similar to:

object(MongoDB\BSON\UTCDateTime)#1 (1) {
  ["milliseconds"]=>
  int(1416445411987)
}


MongoDB\BSON\UTCDateTime || MongoDB\BSON\UTCDateTime::toDateTime || PHP Manual
Live Chat Not Available