Convert WordPress date format to jQuery UI Datepicker format

as for the document of the datapicker UI , I believe you do not need this function .
the document specifies that you can use the following formats :

COOKIE - 'D, dd M yy'
ISO_8601 - 'yy-mm-dd' 

which are ,IMHO, compatible .
At any rate , there are many PHP functions that will help you do time – converstion, you should look at some of them here :

http://www.php.net/manual/en/ref.datetime.php

For example :

you could also define that in Jquery directly like this :

Date.firstDayOfWeek = 0;
Date.format="yyyy-mm-dd";
$(function()
{
    $('.date-pick').datePicker()
});

If none of these solutions suit you there is also a specific plugin that might help :

http://joncom.be/code/jquery-phpdate/