library for working with http date format
npm install http-date[![NPM Version][npm-image]][npm-url]

[![HTTP-DATE][http-date-image]](https://github.com/rxbryan/js-http-date#readme)
This module extends the JavaScript Date to accept valid HTTP-date
formats (as defined in RFC 7231) as constructor initializers and generate
valid IMF_fixdate HTTP-date string format for use in HTTP date header fields.
This is a Node.js module available through the
npm registry. Installation is done using thenpm install command:
``sh`
$ npm install http-dateDate
Accepts every valid constructor argument. Overrides the toString method of the Date class, such that a call to the toString returns the preferred HTTP-date formattoString
(as defined in RFC 7231).
The original behaviour can be obtained by calling with {format: 'standard'} as`
arguments js`
console.log(new httpDate.toString({format: 'standard'}))
`js
var HttpDate = require('http-date')
httpDate = new HttpDate('Sun, 06 Nov 1994 08:49:37 GMT')
`
Using express
`js
var HttpDate = require('http-date')
var Stats = require('fs').Stats
lastModified = new HttpDate(req.get('if-modified-since'))
if (lastmodified.getTime() < stat.mtime.getTime())
res.sendFile(file)
`
`js``
lastModified = new HttpDate()
res.set('Last-modified', lastModified.toString())
[npm-url]: https://www.npmjs.com/package/http-date
[npm-image]: https://img.shields.io/badge/npm-v6.14-blue
[http-date-image]: https://img.shields.io/badge/http--date-v1.0.7-success
[http-date-url]: https://github.com/rxbryan/js-http-date#readme