MySQL datetime format using PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. // Source: http://www.richardlord.net/blog/dates-in-php-and-mysql
  3. // populates $datetime with a valid MySQL DATETIME value
  4. $datetime = date('Y-m-d H:i:s');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.