{"id":33938929,"url":"https://github.com/dobaksz/rsntp","last_synced_at":"2026-04-02T02:08:03.831Z","repository":{"id":43703525,"uuid":"230681774","full_name":"dobaksz/rsntp","owner":"dobaksz","description":"An RFC 5905 compliant Simple Network Time Protocol (SNTP) client library for Rust.","archived":false,"fork":false,"pushed_at":"2026-03-05T12:19:26.000Z","size":83,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T12:57:04.427Z","etag":null,"topics":["async","client","rust","sntp","time"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dobaksz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT","agents":null,"dco":null,"cla":null}},"created_at":"2019-12-28T23:58:02.000Z","updated_at":"2026-03-05T12:16:04.000Z","dependencies_parsed_at":"2025-06-30T22:19:18.414Z","dependency_job_id":null,"html_url":"https://github.com/dobaksz/rsntp","commit_stats":{"total_commits":57,"total_committers":1,"mean_commits":57.0,"dds":0.0,"last_synced_commit":"da2a7e65dc6809bf3b8a8be0528f460f68ab1179"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/dobaksz/rsntp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobaksz%2Frsntp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobaksz%2Frsntp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobaksz%2Frsntp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobaksz%2Frsntp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobaksz","download_url":"https://codeload.github.com/dobaksz/rsntp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobaksz%2Frsntp/sbom","scorecard":{"id":348988,"data":{"date":"2025-08-11","repo":{"name":"github.com/dobaksz/rsntp","commit":"e104ad610f3df76d79b8c386cd0862986b376901"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":4,"reason":"4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T07:50:20.932Z","repository_id":43703525,"created_at":"2025-08-18T07:50:20.932Z","updated_at":"2025-08-18T07:50:20.932Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"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":["async","client","rust","sntp","time"],"created_at":"2025-12-12T15:05:30.537Z","updated_at":"2026-04-02T02:08:03.233Z","avatar_url":"https://github.com/dobaksz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/crates/v/rsntp)](https://crates.io/crates/rsntp)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/dobaksz/rsntp/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/dobaksz/rsntp/tree/master)\n\n# rsntp\n\nAn [RFC 5905](https://www.rfc-editor.org/rfc/rfc5905.txt) compliant Simple Network Time Protocol (SNTP) client\nlibrary for Rust.\n\n`rsntp` provides an API to synchronize time with SNTPv4 time servers with the following features:\n* Provides both a synchronous (blocking) and an (optional) asynchronous, `tokio` based API\n* Optional support for time and date crates `chrono` and `time` (`chrono` is enabled by\n  default)\n* IPv6 support\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nrsntp = \"4.1.1\"\n```\n\nObtain the current local time with the blocking API:\n\n```rust\nuse rsntp::SntpClient;\nuse chrono::{DateTime, Local};\n\nlet client = SntpClient::new();\nlet result = client.synchronize(\"pool.ntp.org\").unwrap();\n\nlet local_time: DateTime\u003cLocal\u003e =\n  DateTime::from(result.datetime().into_chrono_datetime().unwrap());\n\nprintln!(\"Current time is: {}\", local_time);\n```\n\nYou can also use the asynchronous API to do the same:\n\n```rust\nuse rsntp::AsyncSntpClient;\nuse chrono::{DateTime, Local, Utc};\n\nasync fn local_time() -\u003e DateTime\u003cLocal\u003e {\n  let client = AsyncSntpClient::new();\n  let result = client.synchronize(\"pool.ntp.org\").await.unwrap();\n   \n   DateTime::from(result.datetime().into_chrono_datetime().unwrap())\n}\n```\n\n## API changes in version 3.0\n\nVersion 3.0 made core code independent of time and date crates and added support for the `time` crate.\nThis led to some breaking API changes, `SynchronizationResult` methods will return with wrappers\nstruct instead of `chrono` ones. Those wrapper structs has `TryInto` implementation and helper\nmethods to convert them to `chrono` format.\n\nTo convert old code, replace\n```rust\nlet datetime = result.datetime();\n```\nwith\n```rust\nlet datetime = result.datetime().into_chrono_datetime().unwrap();\n```\nor with\n```rust\nlet datetime: chrono::DateTime\u003cUtc\u003e = result.datetime().try_into().unwrap();\n```\n\nThe same applies to `Duration`s returned by `SynchronizationResult`.\n\n## Support for time and date crates\n\n`rsntp` supports returning time and date data in different formats. Currently the format of\nthe two most popular time and date handling crates supported: `chrono` and `time`.\nBy default, `chrono` is enabled, but you can add `time` support with a feature:\n\n```rust\nuse rsntp::SntpClient;\n\nlet client = SntpClient::new();\nlet result = client.synchronize(\"pool.ntp.org\").unwrap();\n\nlet utc_time = result\n  .datetime()\n  .into_offset_date_time()\n  .unwrap();\n\nprintln!(\"UTC time is: {}\", utc_time);\n```\n\nSupport for both crates can be enabled independently; you can even enable both\nat the same time.\n\n## Disabling asynchronous API\n\nThe asynchronous API is enabled by default, but you can disable it. Disabling it \nhas the advantage that it removes the dependency to `tokio`, which reduces \nthe amount of dependencies significantly.\n\n```toml\n[dependencies]\nrsntp = { version = \"4.1.1\", default-features = false, features = [\"chrono\"] }\n```\n\n## System clock assumptions\n\n`rsntp` assumes that system clock is monotonic and stable. This is especially important\nwith the `SynchronizationResult::datetime()` method, as `SynchronizationResult` stores just\nan offset to the system clock. If the system clock is changed between synchronization\nand the call to this method, then offset will not be valid anymore and some undefined result\nwill be returned.\n\n## IPv6 support\n\n`rsntp` supports IPv6, but for compatibility reasons, it binds its UDP socket to an\nIPv4 address (0.0.0.0) by default. That might prevent synchronization with IPv6 servers.\n\nTo use IPv6, you need to set an IPv6 bind address:\n\n```rust\nuse rsntp::{Config, SntpClient};\nuse std::net::Ipv6Addr;\n\nlet config = Config::default().bind_address((Ipv6Addr::UNSPECIFIED, 0).into());\nlet client = SntpClient::with_config(config);\n\nlet result = client.synchronize(\"2.pool.ntp.org\").unwrap();\n\nlet unix_timestamp_utc = result.datetime().unix_timestamp();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobaksz%2Frsntp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobaksz%2Frsntp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobaksz%2Frsntp/lists"}