gtfs-php-sdk
gtfs-php-sdk copied to clipboard
No time in returned DateTime object and no TimeZone management
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.