To display a date retrieved from a recordset in a new format (In this case from a recordset ‘rs_news’):
- <?php echo date(‘d M Y’, strtotime($row_rs_news[‘date’])); ?>
When inserting the date in your MySQL database from an update form it needs to be in the MySQL format yyyy-mm-dd. To update a record in this format use;
- GetSQLValueString(date(‘Y-m-d’, strtotime($_POST[‘date’])), “date”));