PHP Class MongoDate

Afficher le fichier Open project: alcaeus/mongo-php-adapter Class Usage Examples

Méthodes publiques

Свойство Type Description
$sec integer
$usec integer

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
truncateMicroSeconds ( integer $usec ) : integer

Method Details

__construct() public méthode

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() public méthode

Returns a string representation of this date
public __toString ( ) : string
Résultat string

toBSONType() public méthode

Converts this MongoDate to the new BSON UTCDateTime type
public toBSONType ( ) : MongoDB\BSON\UTCDateTime
Résultat MongoDB\BSON\UTCDateTime

toDateTime() public méthode

Returns a DateTime object representing this date
public toDateTime ( ) : DateTime
Résultat DateTime

Property Details

$sec public_oe property

public int $sec
Résultat integer

$usec public_oe property

public int $usec
Résultat integer