{"id":26263886,"url":"https://github.com/pankajkgarg/react-native-truetime","last_synced_at":"2025-04-30T12:40:48.823Z","repository":{"id":57341011,"uuid":"111370611","full_name":"pankajkgarg/react-native-truetime","owner":"pankajkgarg","description":"TrueTime library for React native  to get accurate time from ntp servers","archived":false,"fork":false,"pushed_at":"2017-11-20T06:56:25.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T07:19:05.127Z","etag":null,"topics":["ntp","react-native","time","truetime"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pankajkgarg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-20T06:27:27.000Z","updated_at":"2022-09-01T03:40:02.000Z","dependencies_parsed_at":"2022-09-08T01:50:20.236Z","dependency_job_id":null,"html_url":"https://github.com/pankajkgarg/react-native-truetime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajkgarg%2Freact-native-truetime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajkgarg%2Freact-native-truetime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajkgarg%2Freact-native-truetime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankajkgarg%2Freact-native-truetime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankajkgarg","download_url":"https://codeload.github.com/pankajkgarg/react-native-truetime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251701963,"owners_count":21629925,"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","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":["ntp","react-native","time","truetime"],"created_at":"2025-03-14T01:36:26.036Z","updated_at":"2025-04-30T12:40:48.799Z","avatar_url":"https://github.com/pankajkgarg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-native-truetime\n\n## Getting started\n\n`$ npm install react-native-truetime --save`\n\n### Mostly automatic installation\n\n`$ react-native link react-native-truetime`\n\n### Manual installation\n\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.pkgarg.truetime.RNTrueTimePackage;` to the imports at the top of the file\n  - Add `new RNTrueTimePackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-truetime'\n  \tproject(':react-native-truetime').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-truetime/android')\n  \t```\n3. Add maven repository to `android/build.gradle`:\n    ```\n    allprojects {\n        repositories {\n            maven { url \"https://jitpack.io\" }  // Add this line\n        }\n    }\n    ```\n4. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-truetime')\n      compile 'com.github.instacart.truetime-android:library-extension-rx:3.3'\n  \t```\n\n\n\n## Usage\n```javascript\nimport RNTrueTime from 'react-native-truetime';\n\n// Initialize TrueTime\nRNTrueTime.initTrueTime()\n\n// Returns time in millisecond (as a string)\n...\nconst trueTimeStr = await RNTrueTime.getTrueTime();\nconst trueTime = parseInt(trueTimeStr);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajkgarg%2Freact-native-truetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankajkgarg%2Freact-native-truetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankajkgarg%2Freact-native-truetime/lists"}