MongoDB\BSON\UTCDateTime::toDateTime

(mongodb >=1.0.0)

MongoDB\BSON\UTCDateTime::toDateTimeReturns the DateTime representation of this UTCDateTime

Açıklama

finalpublicMongoDB\BSON\UTCDateTime::toDateTime(): DateTime

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns the DateTime representation of this UTCDateTime. The returned DateTime will use the UTC time zone.

Hatalar/İstisnalar

Örnekler

Örnek 1 MongoDB\BSON\UTCDatetime::toDateTime() example

<?php

$utcdatetime
= new MongoDB\BSON\UTCDateTime(1416445411987);
$datetime = $utcdatetime->toDateTime();
var_dump($datetime->format('r'));
var_dump($datetime->format('U.u'));
var_dump($datetime->getTimezone());

?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

string(31) "Thu, 20 Nov 2014 01:03:31 +0000" string(17) "1416445411.987000" object(DateTimeZone)#3 (2) { ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }

Ayrıca Bakınız

To Top