Parsing date string in RFC 2822 format (as specified in the HTTP header field `last-modified`)

I am using Node.js. The HTTP response header has a last-modified field with a string representing the date and time in accordance with RFC 2822

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

How do I convert this to a Date Javascript object?

+4
source share
1 answer

What happened to JS Date methods?

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

Source: https://habr.com/ru/post/1388173/


All Articles