Reputation: 12417
A user selects dating like 22-Sep-2010 from jQuery datepicker.
Is there a php function to convert that date to 22/09/2010? Could strtottime or mktime be used?
Upvotes: 1
Views: 225
Reputation: 4618
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
Upvotes: 0
Reputation: 42350
$newTime = date('d/M/Y',strtotime($oldTime));
where $oldTime is the value from the date picker.
Upvotes: 6