When I try having a hidden value of the date to be inserted into my submission form in an HTML form, it's not working. I have tried multiple different ways to try to get it to work but it just ends up coming back in the database at "0000-00-00".
Here is my HTML code of the hidden value:
<input type="hidden" name="time_date" value="<?php echo date('H:i:s M d, Y'); ?>" readonly="readonly">
In MySQL/PHPmyAdmin, its type is "DATE". I have tried many different ways for the date to work, but no different formats or anything is working. Anyone who is able to help would be greatly appreciated.
<?php echo time(); ?>for a timestamp and store it as such in the database?date('Y-m-d H:i:s')for insertion into the db.. if you want to display it in a different format then you need to convert it before insert and then convert it before display.