I believe your real issue is the format.
Here is some nice work done on Date formatting in javascript. They provide a
javascript library which might be of some help.
If you can use JQuery plugins, here is
one which I think will be helpful.
Hope this helps!