Datetime Can't Get The Time To Save

Hi,
I started off in Bubble but have just moved across to Wappler. Really liking it so far.

I have setup a local project using docker, node and mysql. I have a field in the database ‘start date and time’ this is setup as a Datetime field.

I then have made a insert query and a bootstrap form. The field is set to date time local.

When I add this it works but the datetime field is always set to midnight rather than the time selected.

image

I just have tried looking around but can’t seem to figure out what I need to do so it saves the date and time. Any help would would be brill.

Thanks,

Just out of curiosity, what happens if you change your field type to varchar (or string if you are using the database manager in Wappler) instead of datetime?

Also is your column actually named ‘start date and time’ with the spaces? You should never have spaces in your field names.

Thanks for getting back to me.

When I change it to string (using Wappler DB manager). It comes up like this:-

image

It is displaying the time now. If I kept it as a string would I be able to perform calculations on this?

Yeah the field doesn’t have any spaces in. :slight_smile:

Thanks,

Using string is not ideal. Technically it should work but leaves yourself open to having dates stored in different formats which will of course break any calculations you want to do. Ideally you want to use datetime. At least we know your form field is working.

How is your form field set up? Any formatting on your date and time picker?

Thanks Brad. No there is no formatting. I did try in the server connect to change the format but it didn’t help

The fact the text was right got me thinking. As a test I have put it back to date and added another entry. Then just done a simple table to list these (below). The times are different in wappler DB editor and the table.

Do you think this could just be displaying it wrong in the Wappler DB editor and is in fact stored correctly?

Thanks,