A PHP representation of the CQL timestamp datatype

Implements

Methods

__construct

( int $seconds, int $microseconds )

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

Parameters:
Name Type Details
$seconds int

The number of seconds

$microseconds int

The number of 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 )

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