Convert "Sun Jul 15 2012 00:00:00 GMT+0700 (SE Asia Standard Time)" to YYYY-mm-dd in php/javascript
===

I am using datepicker from eyecon.ro and I got selected date with  $('input').DatePickerGetDate(); . 

The output is: Sun Jul 15 2012 00:00:00 GMT+0700 (SE Asia Standard Time)

How to convert it to be Y-m-d format?

I've tried these:

1. $('input').DatePickerGetDate("YY-mm-dd");
2. $('input').DatePickerGetDate("Y-m-d");
3. $('input').DatePickerGetDate("YYYY-mm-dd");

but the result is just the same: Sun Jul 15 2012 00:00:00 GMT+0700 (SE Asia Standard Time). 

What should I do?

Thanks.