admin管理员组

文章数量:1316009

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?

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?

Share Improve this question edited Oct 7, 2021 at 5:54 CommunityBot 11 silver badge asked Dec 27, 2011 at 16:46 Colonel PanicColonel Panic 138k97 gold badges418 silver badges480 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

What's wrong with the JS Date methods?

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

本文标签: javascriptParse date string in RFC 2822 format (as found in HTTP header field lastmodified)Stack Overflow