Skip to content

weird display of date #699

@papillon-unix

Description

@papillon-unix

Hello

I'm new to Pico, working on a website with it and I got to love this ultra-light cms very quickly.

Since I need PHP 8 for other needs I run the 3.0.0-alpha.2

Everything works fine except one very annoying thing :

When a YAML file contains a date, for example :

date: 2024-05-05 18:30:00

And when I tried to display it in a template, whether with a date filter or not :

{{ post.date|date("m/d/Y H:i") }} or {{ post.date }}

it returns an UTC time instead of the right time of my timezone. In this case it will display:

2024-05-05 20:30:00 instead of 2024-05-05 18:30:00

I checked that my config is set to Europe/Paris and when I tried to display {{ "now"|date("m/d/Y H:i") }} it returns the correct time.

I searched for hours a solution to this problem and couldn't find it.

So I had to patch my template with something like {% set adjustedDate = post.date|date_modify('-2 hours') %} to get the correct time.

Any idea where does it come from?

Besides, so sad that PicoCMS is abandonned. I tried many flat file cms and this one is really the lightest and the best for my needs.

Thanks a lot if anyone reads me.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions