A PHP representation of the CQL timestamp datatype

Implements

Methods

__construct

( int $time = null, int $usec = null )

Creates a new timestamp from either unix timestamp and microseconds or from the current time by default.

Parameters:
Name Type Details
$time int

Unix timestamp

$usec int

Microseconds

Cassandra\Type

type

( )

The type of this timestamp.

Returns:
Type Details
Cassandra\Type
int

time

( )

Unix timestamp.

Returns:
Type Details
int

seconds

See Also:
float string

microtime

( bool $get_as_float = false )

Microtime from this timestamp

Parameters:
Name Type Details
$get_as_float bool

Whether to get this value as float

Returns:
Type Details
float|string

Cassandra\Float or string representation

See Also:
DateTime

toDateTime

( )

Converts current timestamp to PHP DateTime.

Returns:
Type Details
DateTime

PHP representation

string

__toString

( )

Returns a string representation of this timestamp.

Returns:
Type Details
string

timestamp