final class Date implements Value (View source)

A PHP representation of the CQL date type.

Methods

__construct(int $seconds)

Creates a new Date object

static DateTime
fromDateTime(DateTime $datetime)

Creates a new Date object from a \DateTime object.

type()

The type of this date.

int
seconds()

No description

toDateTime(Time $time)

Converts current date to PHP DateTime.

string
__toString()

No description

Details

__construct(int $seconds)

Creates a new Date object

Parameters

int $seconds

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

static DateTime fromDateTime(DateTime $datetime)

Creates a new Date object from a \DateTime object.

Parameters

DateTime $datetime

A \DateTime object to convert.

Return Value

DateTime

PHP representation

Type type()

The type of this date.

Return Value

Type

int seconds()

No description

Return Value

int

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

DateTime toDateTime(Time $time)

Converts current date to PHP DateTime.

Parameters

Time $time

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

Return Value

DateTime

PHP representation

string __toString()

No description

Return Value

string

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