Skip to content

Filter |localDate does not seem to be taking Bootstrap-set up timezone into account #380

@Marian-Kechlibar

Description

@Marian-Kechlibar

Version: 3.0.18

Let us consider the following date and time:

public string $datetime_released = '2024-10-01 21:37:45 UTC';

If I create a new Nette\Utils\DateTime out of this string:

$time = new Nette\Utils\DateTime($datetime_released)

and run {$time|localDate}, it will show me something like

"dnes 21:37"

IntlDateFormatter, on the other hand, takes the TimeZone set in Bootstrap.php into account:

$configurator->setTimeZone('Europe/Prague');

and will print 23:37, which corresponds to CEST.

It is my opinion that Latte Engine should take the TimeZone set up in the Bootstrap into account when formatting dates and times, too, and the documentation should mention behavior of localDate filter with regard to TimeZone.

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