开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜