jdate saves wrong date

lori19

Active Member
Hi there

This is a strange one that keeps me up:

I have a simple (6-element) repeated group that contains a jdate element. When I select e.g. 30. January 2024, the database stores 29. January 2024 - but the form keeps showing 30. January 2024. I only noticed this because I need that date at another place and it was always one day off.

The jdate element is very simple, with no evals, validations or javascript. When I do a data dump after saving the form ( onBeforeProcess or onAfterProcess) using the PHP form plugin, no values are shown for the element (but the database still stores something).

The issue is not replicable: When I construct a new list with a similar setup everything works fine. So I guess there's a configuration issue or something is interfering.

Any suggestions where I could look?

Thanks!
Lorenz
 
The setting is on UTC and I'm three hours ahead of it (East Africa). As I don't need the time, only the date, this shouldn't be the issue, right?
 
As I don't need the time, only the date, this shouldn't be the issue, right?
It is. date/jdate is always date_time and if you don't set a time it's using "your-date 00:00" and with UTC this will be stored as "your-date-1day 21:00" in your case.
So "When I select e.g. 30. January 2024, the database stores 29. January 2024 - but the form keeps showing 30. January 2024." is totally ok. You only must keep in mind this is UTC time if you are using the value from the DB somewhere else.
 
Thanks for the explanations! Seems I should really look into this time zone thing sometimes...

Have a nice day!

Lorenz
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top