$long_date = '2009-12-09 13:32:15'; $epoch_date = strtotime($long_date); $short_date = date('m/d/Y', $epoch_date);
The above is not the shortest way to do this, but a long date as a timestamp of an era ensures that you can reuse the original long date to get other date format output, for example if you want to return and only have time elsewhere.
Anthony
source share