Posted By

bpa on 04/01/09


Tagged

php datum


Versions (?)

Datetime 2 German Date


 / Published in: PHP
 

Wandelt eine Datetime in eine deutsches Datum um

  1. $date_time = '2008-07-15 16:09:21'
  2.  
  3. $newdate = preg_replace('/^(\d{4,4})\-(\d{2,2})\-(\d{2,2})/', '$3.$2.$1', $date_time);
  4.  
  5. echo $newdate; //15.07.2008 16:09:21

Report this snippet  

You need to login to post a comment.