DateTime

Extends \DateTime

Class DateTime

Extend the default DateTime class with a flag indicating that it only represent a date and the time should be ignored.

package

NextEvent\PHPSDK\Model

Methods

DateTime constructor.

__construct(string $time = 'now', \DateTimeZone|null $timezone = null) 

In addition, check whether this time string is a date only and set a flag. Only this pattern 'Y-m-d' is recognized as a date without time

see http://www.php.net/manual/en/class.datetime.php

Arguments

$time

string

$timezone

\DateTimeZone|null

The __toString method for this class.

__toString() : string

Response

string

Parse ISO8601 string to DateTime object and make sure that it is in the same timezone as used by the server.

fromJson(string $string) : \NextEvent\PHPSDK\Model\DateTime|null
static

Arguments

$string

string

Response

\NextEvent\PHPSDK\Model\DateTime|null

Returns true if this DateTime model only represent a date.

isDateOnly() : boolean

Response

boolean