PHP Класс MongoDate

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$sec integer
$usec integer

Открытые методы

Метод Описание
__construct ( integer $sec, integer $usec ) Creates a new date. If no parameters are given, the current time is used.
__toString ( ) : string Returns a string representation of this date
toBSONType ( ) : MongoDB\BSON\UTCDateTime Converts this MongoDate to the new BSON UTCDateTime type
toDateTime ( ) : DateTime Returns a DateTime object representing this date

Приватные методы

Метод Описание
truncateMicroSeconds ( integer $usec ) : integer

Описание методов

__construct() публичный Метод

Creates a new date. If no parameters are given, the current time is used.
public __construct ( integer $sec, integer $usec )
$sec integer Number of seconds since January 1st, 1970
$usec integer Microseconds

__toString() публичный Метод

Returns a string representation of this date
public __toString ( ) : string
Результат string

toBSONType() публичный Метод

Converts this MongoDate to the new BSON UTCDateTime type
public toBSONType ( ) : MongoDB\BSON\UTCDateTime
Результат MongoDB\BSON\UTCDateTime

toDateTime() публичный Метод

Returns a DateTime object representing this date
public toDateTime ( ) : DateTime
Результат DateTime

Описание свойств

$sec публичное свойство

public int $sec
Результат integer

$usec публичное свойство

public int $usec
Результат integer