cortezaproject / corteza

Low-code platform
https://cortezaproject.org
Apache License 2.0
1.64k stars 373 forks source link

When filtering by today's date, values are selected based on timezone #1858

Open rdr6000 opened 4 months ago

rdr6000 commented 4 months ago

Is there an existing issue for this?

Version of Corteza

2023.9.7

Current Behavior

I am creating a simple Metric to see how many people have punched in today.

I am currently using this query: DATE_FORMAT(createdAt, '%Y-%m-%d') === DATE_FORMAT(NOW(), '%Y-%m-%d') I have also tried the simpler date(createdAt) == date(now())

image

I am seeing this past 12 am so its now the next day. But its still showing the metric from previous day.

image

I have debugged a bit and I saw that the counter actually resets based on my timezone. I am +05:30 so the counter resets at 5:30 in the morning. Any solution or formatting I can use to actually get the correct behaviour?

Expected Behavior

Using this : date(createdAt) == date(now()), the counter should reset at midnight.

Steps To Reproduce

Use : date(createdAt) == date(now()) in a different timezone than UTC 00:00

Environment and versions

Windows 11 and Chrome 126.0.6478.127

Anything else?

No response

Fajfa commented 3 months ago

Can you doublecheck your server/container timezone is set to the correct value? https://forum.cortezaproject.org/t/how-do-i-adjust-the-time-zone-that-corteza-uses/1886

Also might be helpful to consult the forum on this issue.

github-actions[bot] commented 2 weeks ago

Stale issue message