开发者

Format date with jQuery calendar

开发者 https://www.devze.com 2023-02-21 22:47 出处:网络
Using jQuery calendar we got date in \"04/05/2011\" format. I want to convert开发者_如何学Python this into \"Wed, 6th Apr 2011\".

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

精彩评论

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