irwan

PHP Basic : format date to mysql datetime

Nov 15th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.14 KB | None | 0 0
  1. <?php
  2. //formats current date and time to datetime format
  3. //for example:    2004-09-22 21:21:29
  4.  
  5. $mysqlDatetime = date("Y-m-d G:i:s");
  6.  
  7. ?>
  8.  
Advertisement
Add Comment
Please, Sign In to add comment