MongoDate::toDateTime

(PECL mongo >= 1.6.0; PHP > 5.3.4)

MongoDate::toDateTimeReturns a DateTime object representing this date

Опис

public DateTime MongoDate::toDateTime ( void )

Returns a DateTime object representation of this date.

Параметри

В цієї функції немає параметрів.

Значення, що повертаються

This date as a DateTime object.

Приклади

Приклад #1 MongoDate::toDateTime() example

This example demonstrates creating a DateTime object from a MongoDate object.

<?php
$d 
= new MongoDate(strtotime("2014-11-18 11:01:25"));
var_dump$d->toDateTime() );
?>

Наведений вище приклад виведе щось подібне до:

class DateTime#2 (3) {
  public $date =>
  string(26) "2014-11-18 11:01:25.000000"
  public $timezone_type =>
  int(1)
  public $timezone =>
  string(6) "+00:00"
}
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top