Since you already have your date stored in your database in the standard format, you can use a MySQL date function to prepare your data before it sends it to your PHP script.
MySQL DATE FORMAT Function
Otherwise, you can you the function I wrote to do the job. You can find it here:
Reformat Date
It is a quick and easy bit of code that utilizes the strtotime()function in conjunction with the date() function to convert date formats without a lot of extra coding.
As for your JavaScript dates, I don't really do much about JS here but I can go into it if you like...
As for creating a function for your application, it might be a good idea...
If you created a function like the one I did, you could always pass all of your dates through the function to ensure that your website is uniform. You could even set your date format as a variable that you could set in your configuration section of your script which you could change later if you desired to. But that gets a bit into the content management realm of programming.
Hopes this helps,

vujsa