{"id":46300296,"url":"https://github.com/huynguyencong/nhnetworktime","last_synced_at":"2026-03-04T11:02:57.162Z","repository":{"id":62448505,"uuid":"42801161","full_name":"huynguyencong/NHNetworkTime","owner":"huynguyencong","description":"A simple network time protocol SNTP open source for iOS, get the correct time.","archived":false,"fork":false,"pushed_at":"2021-05-24T05:37:38.000Z","size":65,"stargazers_count":119,"open_issues_count":2,"forks_count":22,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-18T22:56:39.042Z","etag":null,"topics":["ios","ntp","ntp-client","ntp-protocol","sntp"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huynguyencong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-20T05:14:43.000Z","updated_at":"2024-12-31T17:27:41.000Z","dependencies_parsed_at":"2022-11-01T22:47:18.871Z","dependency_job_id":null,"html_url":"https://github.com/huynguyencong/NHNetworkTime","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/huynguyencong/NHNetworkTime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huynguyencong%2FNHNetworkTime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huynguyencong%2FNHNetworkTime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huynguyencong%2FNHNetworkTime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huynguyencong%2FNHNetworkTime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huynguyencong","download_url":"https://codeload.github.com/huynguyencong/NHNetworkTime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huynguyencong%2FNHNetworkTime/sbom","scorecard":{"id":474309,"data":{"date":"2025-08-11","repo":{"name":"github.com/huynguyencong/NHNetworkTime","commit":"649fa75e71b7152ba0a953441493949c74c8d26e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"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":"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":"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","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":"Code-Review","score":1,"reason":"Found 4/23 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 11 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-19T14:51:34.040Z","repository_id":62448505,"created_at":"2025-08-19T14:51:34.040Z","updated_at":"2025-08-19T14:51:34.040Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ios","ntp","ntp-client","ntp-protocol","sntp"],"created_at":"2026-03-04T11:02:53.364Z","updated_at":"2026-03-04T11:02:57.137Z","avatar_url":"https://github.com/huynguyencong.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NHNetworkTime\nA network time protocol (NTP) client.\n\n### About\n\nThe clock on the oldest iPhone, iTouch or iPad is not closely synchronized to the correct time. In the case of a device which is obtaining its time from the telephone system, there is a setting to enable synchronizing to the phone company time, but that time has been known to be over a minute different from the correct time.\n\nIn addition, users may change their device time and severely affect applications that rely on correct times to enforce functionality, or may set their devices clock into the past in an attempt to dodge an expiry date.\n\nThis project contains code to provide time obtained from standard time servers using the simple network time protocol (SNTP: RFC 5905). The implementation is not a rigorous as described in that document since the goal was to improve time accuracy to tens of milliSeconds, not to microseconds.\n\nComputers using the NTP protocol usually employ it in a continuous low level task to keep track of the time on a continuous basis.  A background application uses occasional time estimates from a set of time servers to determine the best time by sampling these values over time. iOS applications are different, being more likely to want a one-time, quick estimate of the time.\n\n#### Compatible\n- iOS 7 and later.  \n- Objective C, and Swift with bridge header (read below guide)\n\n### Usage\n\n#### Cocoapod\nAdd below line to Podfile:  \n\n```\npod NHNetworkTime\n```  \nand then run below command in Terminal to install:  \n`pod install`\n\nNote: If above pod isn't working, try using below pod defination in Podfile:  \n`pod 'NHNetworkTime', :git =\u003e 'https://github.com/huynguyencong/NHNetworkTime.git'`\n#### Manual\nAdd all file in folder NHNetworkTime to your project. Then add `CocoaAsyncSocket` use Cocoapod or add manual.\n\n#### Simple to use\nImport this whenever you want to get time:   \n\n```\n#import \"NHNetworkTime.h\"\n```\n\nCall `synchronize` in `- application: didFinishLaunchingWithOptions:` to update time from server when you launch app:\n\n```\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    [[NHNetworkClock sharedNetworkClock] synchronize];\n    return YES;\n}\n```\n\nthen you can get network time when sync complete in anywhere in your source code:\n\n```\nNSDate *networkDate = [NSDate networkDate];\n```\n\nor add notification to re-update your UI in anywhere you want when time is updated:\n\n```\n[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkTimeSyncCompleteNotification:) name:kNHNetworkTimeSyncCompleteNotification object:nil];\n```\n\n#### Swift\n#####Use `use_frameworks!`\n\nIf you have `use_frameworks!` option in Podfile, import `NHNetworkTime` framework in each code file use `NHNetworkTime` objects:\n\n```\n@import NHNetworkTime\n```\n\n\n##### Not use `use_frameworks!`\n\n\nImport `NHNetworkTime.h` to your in bridge header file:  \n\n```\n#import \u003cNHNetworkTime.h\u003e\n```\n* You can create bridge header file by create an Objective C file in project. Xcode will ask you to create bridge header file. After, you can delete the temporatory Objective C file have just added, and import `NHNetworkTime.h` into there (Read more: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html)\n\n##### In your code\nNow, you can call below code in your code:  \n\n```\nNHNetworkClock.sharedNetworkClock().synchronize()\n```\nand:\n\n```\nNSNotificationCenter.defaultCenter().addObserver(self, selector: Selector(\"syncCompleteNotification\"), name: kNHNetworkTimeSyncCompleteNotification, object: nil)\n```\n#### More from NHNetworkClock\n- Use `NSNotifcationCenter` to add observer `kNHNetworkTimeSyncCompleteNotification` to receive notification when time sync complete\n- Property `isSynchronized`: Check network time synchronized or not\n- Property `shouldUseSavedSynchronizedTime`: Should use offset time saved in the last synchronization before sync from server. Default is YES.\n- Property `isAutoSynchronizedWhenUserChangeLocalTime`: Is auto sync when user change local time. Default is YES.\n\n#### Custom time server\nAdd to project file name `ntp.hosts`, with content is time server address in every line. If file is not exist, it will use default time server. Example for `ntp.hosts` file:\n\n```\nasia.pool.ntp.org\neurope.pool.ntp.org\nnorth-america.pool.ntp.org\n```\n\n\n### About this source\nNHNetworkTime is built from ios ntp open source from jbenet. NHNetworkTime fixed a critical bug get wrong time from origin source, and added more improvements:\n\n- Post notification when sync complete\n- Property make you know whether sync complete or not\n- Save offset time local to use immediately right after launch app, don't have to waiting for server\n- Auto sync when user change local time\n\n### License\nNHNetworkTime is released under the Apache license. See LICENSE for details. Copyright © Nguyen Cong Huy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuynguyencong%2Fnhnetworktime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuynguyencong%2Fnhnetworktime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuynguyencong%2Fnhnetworktime/lists"}