Colonel Panic
Colonel Panic

Reputation: 137594

Parse date string in RFC 2822 format (as found in HTTP header field `last-modified`)

I'm using Node.js . In a HTTP response header is a field last-modified with a string representing a date and time according to RFC 2822

 'last-modified': 'Tue, 27 Dec 2011 02:12:35 GMT',

How do I convert this to a Javascript Date object?

Upvotes: 6

Views: 5151

Answers (1)

user578895
user578895

Reputation:

What's wrong with the JS Date methods?

new Date( 'Tue, 27 Dec 2011 02:12:35 GMT' )

Upvotes: 8

Related Questions