PHP Class MongoDate

Mostra file Open project: alcaeus/mongo-php-adapter Class Usage Examples

Public Properties

Property Type Description
$sec integer
$usec integer

Public Methods

Method 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

Method Description
truncateMicroSeconds ( integer $usec ) : integer

Method Details

__construct() public method

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 method

Returns a string representation of this date
public __toString ( ) : string
return string

toBSONType() public method

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

toDateTime() public method

Returns a DateTime object representing this date
public toDateTime ( ) : DateTime
return DateTime

Property Details

$sec public_oe property

public int $sec
return integer

$usec public_oe property

public int $usec
return integer