{"id":23219623,"url":"https://github.com/barcek/httpdt","last_synced_at":"2026-02-11T02:37:59.745Z","repository":{"id":250204647,"uuid":"833780782","full_name":"barcek/httpdt","owner":"barcek","description":"worldwide when | easy-audit datetime library for HTTP | Rust (std only)","archived":false,"fork":false,"pushed_at":"2025-01-10T21:49:50.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T06:56:39.508Z","etag":null,"topics":["backend","datetime","gmt","http","imf-fixdate","library","rust","web-development"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/barcek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-25T18:24:06.000Z","updated_at":"2025-01-14T12:51:05.000Z","dependencies_parsed_at":"2024-07-25T21:47:19.104Z","dependency_job_id":"841e21f5-9ebd-4f0d-b687-fbab0754089f","html_url":"https://github.com/barcek/httpdt","commit_stats":null,"previous_names":["barcek/httpdt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/barcek/httpdt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fhttpdt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fhttpdt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fhttpdt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fhttpdt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barcek","download_url":"https://codeload.github.com/barcek/httpdt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barcek%2Fhttpdt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644764,"owners_count":24621332,"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-08-15T02:00:12.559Z","response_time":110,"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":["backend","datetime","gmt","http","imf-fixdate","library","rust","web-development"],"created_at":"2024-12-18T21:36:08.239Z","updated_at":"2026-02-11T02:37:54.726Z","avatar_url":"https://github.com/barcek.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httpdt\n\nA datetime library for HTTP clients and servers.\n\nGenerates timestamps for use in the HTTP Date header, the only format required for implementation of HTTP.\n\nCalculates with a focus on clarity from `SystemTime`, with no external dependencies, and provides for updates to previously generated datetimes for speed.\n\nAvailable via [crates.io](https://crates.io/crates/httpdt):\n\n```shell\ncargo add httpdt@0.1.0\n```\n\n## Why?\n\nFor a smaller surface area and better understanding of the underlying logic when implementing a client or server. No need to audit a more extensive datetime crate to generate a single relatively straightforward output.\n\n## How?\n\nInstantiate a `Datetime` struct with the `new` method, then get the current timestamp for the 'Date' header field with `for_header`:\n\n```rust\nuse httpdt::Datetime;\n\nlet timestamp = Datetime::new()?\n  .for_header();\n```\n\nTo reduce computation, an initial instance can be used as the basis for successive new timestamps via the `now` method:\n\n```rust\nuse httpdt::Datetime;\n\nlet dt = Datetime::new()?;\n\nlet ts_initial = dt\n  .for_header();\n// ...\nlet ts_updated = dt\n  .now()?\n  .for_header();\n```\n\nThe `default` method provides a `Datetime` instance corresponding to the Unix epoch, the `raw` method the number of seconds since the epoch.\n\n### Docs\n\nThe documentation is available at [docs.rs](https://docs.rs/httpdt/latest). It can be built and viewed locally in the browser with the following command:\n\n```shell\ncargo doc --open\n```\n\n## Making changes\n\nRunning the tests after making changes and adding tests to cover new behaviour is recommended.\n\n### Tests\n\nThe unit tests and documentation example can be run with the following command:\n\n```shell\ncargo test\n```\n\nThe unit test cases for each component are in the test module at the base of the corresponding source file.\n\n## Development plan\n\nThe following are the expected next steps in the development of the code base. The general medium-term aim is a clear, robust and efficient datetime resource for fuller HTTP implementations. Pull requests are welcome for these and other potential improvements.\n\n- implement a top-level error type\n- revisit cross-component integer typing\n- document and expose the individual components\n- handle timezones, allowing for generation of server log entries in Common Log Format\n- revise `SystemTime`-dependent testing\n- extend test modules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcek%2Fhttpdt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarcek%2Fhttpdt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarcek%2Fhttpdt/lists"}