How can I change PHP date format
A user selects dating like 22-Sep-2010 from jQuery datepicker.
Is there a php function to 开发者_JAVA技巧convert that date to 22/09/2010? Could strtottime or mktime be used?
$newTime = date('d/M/Y',strtotime($oldTime));
where $oldTime is the value from the date picker.
To convert the date format from dd-mmm-yyyy to dd/mm/yyyy in php,
<?php
$dt='22-Sep-2010';
$dt=date('d/m/Y',strtotime($dt));
echo $dt;
?>
The o/p will be, 22/09/2010
精彩评论