Trying to store data fields for a timesheet application. How can I convert a text field in a form with date and time in it correctly formatted for a mysql date or time field? I get a server error and the field won’t load. If I set the form text field as a date, it doesn’t work either. However, when I use just a date, not date and time, I can insert that into a mysql database.
I also can’t seem to figure out how to use the time picker. I can select the time but it doesn’t actually store anything into the field using it. There is no apply or similar button. I don’t know why I’m just going nuts trying to figure this out. I’m sure it’s simple and I’m just have a senior moment. Any help appreciated.
no Wappler experience here, but
do you know for sure the format that MySql is expecting?
have you seen the raw data in mysqlworkbench?
… or seen a working INSERT statement?
I’m new, so i don’t know enough about the middleware thats generating the INSERT, but the time format can include timezone offset, or not depending on the database type (I’m a MS SQL guy myself).
‘19-Mar-2022T23:00:00-4:00’ is diff. than
‘19-Mar-2022 23:00:00’
I don’t know yet whose responsibility it is in the framework to match the data format.
Have you checked the Chrome inspector to look at the POST to see whats being sent?
I’m only replying in case this helps a tiny bit tonight - am sure someone will reply soon that knows the exact answer.
Jaymer…
I get a status code 500 in the developer tools when I turn on the debug. I can see the payload as the form with the correct looking data. It doesn’t seem to matter whether I have the mysql fields at date, time , datetime, or text. The form fields are text but formatted to the date yyyy-MM-dd HH:mm:ss. When I take those fields off, the form submits fine so its the date fields which cause the problem.