PHP Class Cassandra\Timestamp

Inheritance: implements cassandra\Value
Show file Open project: datastax/php-driver

Public Methods

Method Description
__construct ( integer $time = null, integer $usec = null ) Creates a new timestamp from either unix timestamp and microseconds or from the current time by default.
__toString ( ) : string Returns a string representation of this timestamp.
microtime ( boolean $get_as_float = false ) : float | string Microtime from this timestamp
time ( ) : integer Unix timestamp.
toDateTime ( ) : DateTime Converts current timestamp to PHP DateTime.
type ( ) : cassandra\Type The type of this timestamp.

Method Details

__construct() public method

Creates a new timestamp from either unix timestamp and microseconds or from the current time by default.
public __construct ( integer $time = null, integer $usec = null )
$time integer Unix timestamp
$usec integer Microseconds

__toString() public method

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

microtime() public method

Microtime from this timestamp
See also: microtime
public microtime ( boolean $get_as_float = false ) : float | string
$get_as_float boolean Whether to get this value as float
return float | string Float or string representation

time() public method

Unix timestamp.
See also: time
public time ( ) : integer
return integer seconds

toDateTime() public method

Converts current timestamp to PHP DateTime.
public toDateTime ( ) : DateTime
return DateTime PHP representation

type() public method

The type of this timestamp.
public type ( ) : cassandra\Type
return cassandra\Type