Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String date and string manipulation with jQuery

Tags:

jquery

I have a string : 30/09/2010 and I'd like have 09/30/2010 hiw can I do this useing jQuery ?

Thanks,

like image 443
Kris-I Avatar asked Dec 05 '25 15:12

Kris-I


2 Answers

You no need Jquery it's very simple code :

var s_date = '30/09/2010'.split("/");
var org_date = s_date[1] + "/" + s_date[0] + "/" + s_date[2];
like image 166
john misoskian Avatar answered Dec 07 '25 15:12

john misoskian


There is a jquery datapicker at http://jqueryui.com/demos/datepicker/

It has a few static methods that may be of use to you, and would allow you to do something like:

var dstr = $.datepicker.formatDate('mm/dd/yy', 
                    $.datepicker.parseDate('dd/mm/yy', '30/09/2010'));
like image 29
zod Avatar answered Dec 07 '25 15:12

zod



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!