You could try the datejs library. Link: http://code.google.com/p/datejs/

It allows various parsing and formatting ways. Check the sample usage section for more details.