Posted By

isaac on 04/15/08


php date format to usa transform reverse easy d-m-y y-m-d european

Versions (?)

Easy transform date format y-m-d => d-m-y on PHP

 / Published in: PHP


This changes the date format from y-m-d to d-m-y on PHP. It's easy to change the - to / or spaces...

  1. //This code is extracted from the comments on the docs
  3. # Date: y-m-d => d-m-y
  4. $time =explode("-","2008-01-01");
  5. krsort($time);
  6. print implode("-",$time);
  8. //Will return: 01-01-2008.

Report this snippet  

You need to login to post a comment.