[Solved] list is showing me a date and the database is recorded another one

Status
Not open for further replies.

shortbow

New Member
Hi!

I'm saving events in a fullcalender and while when I save an event say to 28/04/2018-29/04/2018 and it shows that date, in the database it's showing 27/04/2018 23:00:00 to 28/04/2018 23:00:00. (field datetime, fabrik element date)

it was working fine until 24hours ago, and I can't think what I could have done that's forcing this behavior.
worst... this is playing hell with availability php code...

any help is very much apreciated!!!
 
Unless you have set 'store as local' on the date element, we store dates in GMT, and apply TZ offsets when rendering / filtering.

Did your time zone transition to DST rcently?

If you do your own date handling, especially if it's looking at the database directly, you have to account for the TZ offsets yourself.

Or set the date element to store as local. Although think carefully before doing that, as it makes your dates a lot less portable, and carries it's own set of issues. Typically most database driven apps that use dates will store them as GMT. That way, if (say) the application layer (in this case J!) resets it's time zone ... or if you need to show different users different TZ's ... or if you migrate your data to a server in a different TZ ... or ...

-- hugh
 
Thanks hugh!

I'm sorry for the delay on my answer.
That did the trick. I put my joomla site in UTC and the elements TZ also in UTC and now I got consistent values between the database and the lists and forms.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top