MongoDate
PHP Manual

MongoDate::__construct

(PECL mongo >= 0.8.1)

MongoDate::__constructCreates a new date.

설명

MongoDate::__construct ([ long $sec [, long $usec ]] )

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

인수

sec

Number of seconds since January 1st, 1970.

usec

Microseconds.

반환값

Returns this new date.

예제

Example #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";

?>

위 예제의 출력 예시:

0.23660600 1235685067
0.00000000 1234567890

참고


MongoDate
PHP Manual