downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoDate::__toString> <MongoDate
[edit] Last updated: Fri, 25 May 2012

view this page in

MongoDate::__construct

(PECL mongo >= 0.8.1)

MongoDate::__construct新しい日付を作成する

説明

public MongoDate::__construct ([ int $sec = time() [, int $usec = 0 ]] )

新しい日付を作成します。パラメータを指定しなかった場合は現在時刻を使用します。

パラメータ

sec

1970年1月1日からの経過秒数。

usec

マイクロ秒。

返り値

新しい日付を返します。

例1 MongoDate::__construct() の例

この例は、現在時刻および指定した時刻で新しい日付を作成する方法を示すものです。

<?php

$d 
= new MongoDate();
echo 
"$d\n";
$d = new MongoDate(1234567890);
echo 
"$d\n";
$d = new MongoDate(strtotime("2009-05-01 00:00:01"));
echo 
"$d\n";

?>

上の例の出力は、 たとえば以下のようになります。

0.23660600 1235685067
0.00000000 1234567890

参考



add a note add a note User Contributed Notes MongoDate::__construct
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites