GoLang MongoDate::toDateTime

request it (260)
GoLang replacement for PHP's MongoDate::toDateTime [edit | history]

Do you know a GoLang replacement for PHP's MongoDate::toDateTime? Write it!

PHP MongoDate::toDateTime

PHP original manual for MongoDate::toDateTime [ show | php.net ]


(PECL mongo >= 1.6.0)

MongoDate::toDateTimeReturns a DateTime object representing this date


public DateTime MongoDate::toDateTime ( void )

Returns a DateTime object representation of this date.


This function has no parameters.

Return Values

This date as a DateTime object.


Example #1 MongoDate::toDateTime() example

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

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

The above example will output something similar to:

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