开发者

Format date with jQuery calendar

Using jQuery calendar we got date in "04/05/2011" format.

I want to convert开发者_如何学Python this into "Wed, 6th Apr 2011".

Please help.


I would recommend to use the datepicker from the jqueryui library.

You can set the format of the datepicker like this.

$( ".selector" ).datepicker({ altFormat: 'D, d M y' });

find more here: http://jqueryui.com/demos/datepicker/


To convert the date in PHP just do something like this

$date = '04/05/2011';
$new_date = time('D, d M y', strtotime($date));

$new_date will now have the data as you want it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜