Click here to Skip to main content
15,301,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a date in UTC format like "Mon Feb 12 22:07:13 UTC +0530 2007" and I have to display it into normal date format like "1st Jan 2010" in javascript? Can anyone suggest solutions?
Updated 17-Sep-12 21:18pm

You better format it on server side (see.[^]), but it depends how you process your data on client side, and how you get your date data from the server.
Hi DivyaJ,
U can use following Jquery code.
$"2009-12-18 10:54:50.546", "dd-MM-yyyy");

Hope it will work for you.....
Here is a simple javascript solution to give you an idea,

var d = new Date("Mon Feb 12 22:07:13 UTC +0530 2007");
var n = ''+d.getUTCDate()+' '+d.getUTCMonth()+' '+d.getUTCFullYear()+'';

Output: 12 2 2007

You can add Jan/Feb and suffix 'st' etc as you prefer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900