How to convert UTC datetime to different format
I have a datetime string in the following format.
var datetime="Thu May 5 05:30:00 UT开发者_开发问答C+0530 2011" ;
I want to convert it in the following format. How can I do it in javascript
"Thursday, 05 May 2011"
The globalize plugin has date parsing and formatting features.
Here is an example from the plugin page:
Globalize.format( new Date(1955,10,5), "dddd MMMM d, yyyy" ); // "Saturday November 5, 1955"
The date.js library is very useful for working with Dates.
Formatting examples:
Date.today().toString("dddd MMMM d, yyyy"); // Monday November 19, 2007
Date.today().toString(); // native .toString() functionality
Date.today().toString("M/d/yyyy"); // 11/19/2007
Date.today().toString("d-MMM-yyyy"); // 19-Nov-2007
new Date().toString("HH:mm"); // 18:45
Parsing examples:
Date.parse('today');
Date.parse('t + 5 d'); // today + 5 days
Date.parse('next thursday');
Date.parse('February 20th 1973');
Date.parse('Thu, 1 July 2004 22:30:00');
精彩评论