Advertisement
jchaven

Use date to display a timestamp

May 30th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2. $mydate = '2012-05-28 13:22:55';
  3.  
  4. echo date('m/d/Y', strtotime($mydate));
  5. // displays: 05/28/2012
  6.  
  7. echo date('Y-m-d H:i:s', strtotime($mydate));
  8. // displays: 2012-05-28 13:22:55
  9.  
  10.  
  11. // see: http://php.net/manual/en/function.date.php
  12.  
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement