I'm trying to display the date and time in mySQL timestamp format in an input field.
I tried this:
<td align="left"><input size="50" maxlength="250" type="text" name="date" value="<?php NOW(); ?>"></td>
But it is not working what did I do wrong?
NOW() is a MySQL function not PHP (afaik)... use mysql_query() function to query MySQL and then use NOW() in that query... or use Date() function of PHP you can select various formats from there
Good Luck TommYNandA
Is there a way, with PHP, to display the current time and date in my input field in the YYYYMMDD format?
http://us4.php.net/manual/en/function.date.php
scroll down for examples
Originally posted by tommynanda http://us4.php.net/manual/en/function.date.php scroll down for examples
Thanks.
Resolved.