Datetime 2 German Date


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

Wandelt eine Datetime in eine deutsches Datum um


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.