MongoDate
PHP Manual

MongoDate::__construct

(PECL mongo >= 0.8.1)

MongoDate::__constructCreates a new date.

Descrição

MongoDate::__construct ([ long $secs ] )

Creates a new date. If no parameter is given, the current time is used.

Parâmetros

secs

Number of seconds since January 1st, 1970.

Valor Retornado

Returns the new date.

Exemplos

Exemplo #1 MongoDate::__construct() example

This example demonstrates creating a new date with the current time and a new date with a given time.

<?php

$d 
= new MongoDate();
echo 
"$d\n";
$d = new MongoDate(1234567890);
echo 
"$d\n";

?>

O exemplo acima irá imprimir algo similar a:

0.23660600 1235685067
0.00000000 1234567890

Veja Também


MongoDate
PHP Manual