Problem recording time in database

jfquestiaux

Well-Known Member
My setting :
  • a simple contact form where the user can pick a date/hour to book for lunch - Time selector is turned ON
  • an email is sent (via the email form plugin) to the owner as a notice for a booking
The test: booking for Feb 16 at 12:00

The issues :
* With UTC time and "Y-m-d H: i : s" form format, I have "2015-02-16 11:41:00" recorded in the db (12:41 is the time of the test) and "16/02/2015 13:00:00" in the email.

*With "Y-m-d" as form format, I have "2015-02-16 00:00:00" in the db and "16/02/2015 13:00:00" in the email.

*With Local time and either form format (with or without time), I have "2015-02-16 12:45:00" in db (12:45 is time of test) and "16/02/2015 12:00:00" in email (correct)

*Finally, with "d-m-Y" as form format (witch is more readable for Belgian users), I have "2015-02-16 00:00:00" in the db and "16/02/2015 12:00:00" in the email.

At least I can get the right date/time in the email but never in the database (which means in list view).
Main problem seems that the time picked in the selector is never taken into account for the data recorded, even though this data is recorded correctly upon submission since it's correct in the email.

Note also that you have to use "Y-m-d" because "Y m d" will cause a "___dateTime Construct" error (unexpected character).

This is tested with GitHub from Feb 13.
 
So these issues (missing time in DB, format error) are only if the email plugin is enabled?
 
Just out of interest (while I await the answer to Troester's question), when you say:

"16/02/2015 12:00:00" in email (correct)

... is that the format you were expecting? I don't see anywhere where you specified d/m/Y as the date part of the format. Or are you formatting the email separately in a template?

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top