Skip to content

Method UTCDateTime::toDateTime doesn't respect current timezone #246

Closed
@jakubboucek

Description

@jakubboucek

Object DateTime has $timezone as one of internal variable used for correct convert between date formats. If is not defined in call new DateTime(), is set to current timezone based on date_default_timezone_set() function or php.ini configuration.

Method UTCDateTime::toDateTime is ignoring this convention and always create DateTime object with timezone +0000 and is necessarily to keep in mind and rewrite timezone on every use this method:

$UTCDateTime->toDateTime()->setTimeZone( new \DateTimeZone( date_default_timezone_get() ) );

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