{"id":22377616,"url":"https://github.com/pimm/parsehttpdate","last_synced_at":"2025-10-15T13:55:57.501Z","repository":{"id":33954847,"uuid":"147350273","full_name":"Pimm/parseHttpDate","owner":"Pimm","description":"Parses the value of the Date header in HTTP responses","archived":false,"fork":false,"pushed_at":"2024-09-01T18:11:41.000Z","size":557,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-17T15:40:15.782Z","etag":null,"topics":["date","dates","http","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pimm.png","metadata":{"files":{"readme":"readme-nl.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"copying.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-04T13:25:42.000Z","updated_at":"2024-09-01T17:53:59.000Z","dependencies_parsed_at":"2023-01-15T03:35:20.604Z","dependency_job_id":null,"html_url":"https://github.com/Pimm/parseHttpDate","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Pimm/parseHttpDate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pimm%2FparseHttpDate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pimm%2FparseHttpDate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pimm%2FparseHttpDate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pimm%2FparseHttpDate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pimm","download_url":"https://codeload.github.com/Pimm/parseHttpDate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pimm%2FparseHttpDate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267960696,"owners_count":24172506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","dates","http","javascript"],"created_at":"2024-12-04T22:14:56.789Z","updated_at":"2025-10-15T13:55:57.399Z","avatar_url":"https://github.com/Pimm.png","language":"JavaScript","readme":"# parsehttpdate \u0026middot; [![Licentie (X11/MIT)](https://badgen.net/github/license/pimm/parseHttpDate)](https://github.com/Pimm/parseHttpDate/blob/master/copying.txt) [![npm versie](https://badgen.net/npm/v/parsehttpdate)](https://www.npmjs.com/package/parsehttpdate) [![Test status](https://github.com/Pimm/parseHttpDate/actions/workflows/test.yaml/badge.svg)](https://github.com/Pimm/parseHttpDate/actions/workflows/test.yaml) [![Coverage status](https://coveralls.io/repos/github/Pimm/parseHttpDate/badge.svg?branch=master)](https://coveralls.io/github/Pimm/parseHttpDate?branch=master)\n\nOntleedt de waarde van de `Date` header in HTTP antwoorden.\n\n## Omschrijving\n\nOntleedt datum-tijdstippen van HTTP-headers zoals _Date_, _Last-Modified_, en _Expires_. Een voorbeeld van zo een datum-tijdstip is:\n\n\u003e Tue, 15 Nov 1994 08:12:31 GMT\n\nHet formaat is [gedefinieerd door HTTP/1.1][http-1.1] (en [HTTP/1.0][http-1.0]) en is een subgroep van de specificatie die wordt gebruikt door in het [Internet Message Format][imf].\n\n# Installatie\n\nInstalleer `parsehttpdate` met npm of Yarn en importeer de functie:\n```javascript\nimport parseHttpDate from 'parsehttpdate';\n```\n\nAls alternatief kan `parsehttpdate` ook worden binnengehaald met unpkg:\n```html\n\u003cscript src=\"https://unpkg.com/parsehttpdate@^1.0.12\"\u003e\u003c/script\u003e\n```\nMet deze aanpak wordt de functie beschikbaar als `window.parseHttpDate`.\n\n# Gebruik\n\n```javascript\nparseHttpDate('Wed, 21 Oct 2015 07:28:00 GMT');\n```\n\n### In combinatie met [fetch][mdn-fetch]\n\nOp deze manier vind je de tijd volgens jouw server:\n\n```javascript\nimport parseHttpDate from 'parsehttpdate';\n\nfetch('/')\n.then(({ headers }) =\u003e headers.get('Date'))\n.then(parseHttpDate)\n.then(date =\u003e {\n\tconsole.log(date.toTimeString());\n});\n```\n\nDit is hetzelfde voorbeeld met een [async-functie][mdn-async-function]:\n\n```javascript\nimport parseHttpDate from 'parsehttpdate';\n\nasync function getServerDate() {\n\tconst { headers } = await fetch('/');\n\treturn parseHttpDate(headers.get('Date'));\n}\n\ngetServerDate()\n.then(date =\u003e {\n\tconsole.log(date.toTimeString());\n});\n```\n\n### Geavanceerd gebruik\n\nAls je er vrij zeker van bent dat de invoer is opgeschreven in het correcte formaat, kun je de prestaties nog iets verbeteren door validatie uit te zetten.\n\n```javascript\nparseHttpDate('Wed, 21 Oct 2015 07:28:00 GMT', false);\n```\n\n## Andere formaten\n\nZiet jouw datum-tijdstip er niet uit zoals het voorbeeld hierboven, maar meer zo?\n\n\u003e 1994-11-06T08:49:37Z\n\nGefeliciteerd: jouw datum-tijdstip is opgeschreven in het [ISO 8601][ecmascript-10-date-time]-formaat. _Je hebt deze bibliotheek niet nodig_. Je hebt geen enkele bibliotheek nodig:\n\n```javascript\nnew Date('1994-11-06T08:49:37Z');\n```\n\nDe HTTP/1.1-specificatie definieert ook twee verouderde formaten naast het aangerade formaat van de bovengenoemde voorbeelden:\n\n\u003e Sunday, 06-Nov-94 08:49:37 GMT\n\n\u003e Sun Nov  6 08:49:37 1994\n\nDeze bibliotheek ondersteunt deze niet; sinds 1996 is het gebruik van het ondersteunde formaat aanbevolen. [Maak alsjeblieft een issue aan][issues] als je de overige toch nodig hebt.\n\n## Licentie (X11/MIT)\nCopyright (c) 2018-2021 Pimm \"de Chinchilla\" Hogeling\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n**The Software is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.**\n\n\n[http-1.1]: https://tools.ietf.org/html/rfc7231#section-7.1.1.1\n[http-1.0]: https://tools.ietf.org/html/rfc1945#section-3.3\n[imf]: https://tools.ietf.org/html/rfc5322\n[ecmascript-10-date-time]: http://www.ecma-international.org/ecma-262/10.0/#sec-date-time-string-format\n[mdn-fetch]: https://developer.mozilla.org/docs/Web/API/Fetch_API\n[mdn-async-function]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/async_function\n[issues]: https://github.com/Pimm/parseHttpDate/issues","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimm%2Fparsehttpdate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpimm%2Fparsehttpdate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimm%2Fparsehttpdate/lists"}