Skip to content

No time in returned DateTime object and no TimeZone management #12

@marcdeldem

Description

@marcdeldem

For CalendarDate, getDate returns a DateTime without settings the time in the DateTime object.
So the time used to create the DateTime object is therefore the current time.
Perhaps, settings the time to 00:00:00 would be better (adding '!' in the mask format)

public function getDate() : DateTime
{
    return DateTime::createFromFormat("!Ymd", $this->date);
}

Same problem for CalendarEntry :

public function getStartDate(): DateTime
{
    return DateTime::createFromFormat("!Ymd", $this->start_date);
}

public function getEndDate(): DateTime
{
    return DateTime::createFromFormat("!Ymd", $this->end_date);
}

And there is no TimeZone management. But Agency object contains a TimeZone that could be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions