1

I have a datetime string in the following format.

var datetime="Thu May 5 05:30:00 UTC+0530 2011" ;

I want to convert it in the following format. How can I do it in javascript

"Thursday, 05 May 2011"

2 Answers 2

1

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"
Sign up to request clarification or add additional context in comments.

2 Comments

Where did the OP tell that he's using jQuery?
The globalize plugin does not need jQuery.
0

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');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.