A PHP representation of the CQL date type.

Implements

Methods

__construct

( int $seconds )

Creates a new Cassandra\Date object

Parameters:
Name Type Details
$seconds int

Absolute seconds from epoch (1970, 1, 1), can be negative, defaults to current time.

Cassandra\Type

type

( )

The type of this date.

Returns:
Type Details
Cassandra\Type
int

seconds

( )
Returns:
Type Details
int

Absolute seconds from epoch (1970, 1, 1), can be negative

DateTime

toDateTime

( Cassandra\Time $time )

Converts current date to PHP DateTime.

Parameters:
Name Type Details
$time Cassandra\Time

An optional Cassandra\Time object that is added to the DateTime object.

Returns:
Type Details
DateTime

PHP representation

string

__toString

( )
Returns:
Type Details
string

this date in string format: Cassandra\Date(seconds=$seconds)

static DateTime

fromDateTime

( DateTime $datetime )

Creates a new Cassandra\Date object from a DateTime object.

Static
This method is static
Parameters:
Name Type Details
$datetime DateTime

A DateTime object to convert.

Returns:
Type Details
DateTime

PHP representation