{"id":28246076,"url":"https://github.com/raheemadamboev/server-time-android","last_synced_at":"2026-05-05T19:31:23.111Z","repository":{"id":40443435,"uuid":"414331659","full_name":"raheemadamboev/server-time-android","owner":"raheemadamboev","description":"🕜 Light library to get real UNIX time from the server in android","archived":false,"fork":false,"pushed_at":"2025-08-03T09:48:06.000Z","size":10352,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T11:29:49.277Z","etag":null,"topics":["android","android-library","get-time","internet-time","server-time"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/raheemadamboev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-06T18:42:36.000Z","updated_at":"2025-08-03T09:48:09.000Z","dependencies_parsed_at":"2025-08-03T11:37:37.637Z","dependency_job_id":null,"html_url":"https://github.com/raheemadamboev/server-time-android","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/raheemadamboev/server-time-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fserver-time-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fserver-time-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fserver-time-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fserver-time-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raheemadamboev","download_url":"https://codeload.github.com/raheemadamboev/server-time-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fserver-time-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32664753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"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":["android","android-library","get-time","internet-time","server-time"],"created_at":"2025-05-19T09:13:47.329Z","updated_at":"2026-05-05T19:31:23.106Z","avatar_url":"https://github.com/raheemadamboev.png","language":"Kotlin","funding_links":[],"categories":["Programming Languages, Libraries"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eServer Time\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://developer.android.com/index.html\"\u003e\u003cimg alt=\"Android\" src=\"https://img.shields.io/badge/platform-android-green.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://jitpack.io/#raheemadamboev/server-time-android\"\u003e\u003cimg alt=\"Version\" src=\"https://jitpack.io/v/raheemadamboev/server-time-android.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=21\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n🕜 \u003cb\u003eServerTimeAndroid\u003c/b\u003e is a light library to get real UNIX time from the Google server in Android. Sometimes phone's local date can be wrong so for the best accuracy it is better to get time from the server. It gets time from the Google server and always gets the correct date.\n\u003c/p\u003e\n\n# Setup\n\nAdd the maven library bucket to the `dependencyResolutionManagement.repositories` block in `settings.gradle.kts` file as follows:\n```kotlin\ndependencyResolutionManagement {\n  ...\n  repositories {\n    ...\n    maven(\"https://jitpack.io\")\n  }\n}\n```\n\nInstall the library to the project in desired module's `build.gradle.kts` file. Replace `\u003ccurrent_version\u003e` with the actual version:\n```kotlin\nimplementation(\"com.github.raheemadamboev:server-time-android:\u003ccurrent_version\u003e\")\n```\n\n# Implementation\n\n**Get server time (callback API):**\n```kotlin\n ServerTime().execute { time -\u003e\n  \n  when (time) {\n    ServerTime.Result.UNKNOWN_HOST -\u003e { \n      // handle internet not working or error in host                      \n    }\n\n    ServerTime.Result.IO_EXCEPTION -\u003e { \n      // handle io exception                  \n    }\n\n    else -\u003e { \n      // time (milli seconds) was retreived successfully\n      // println(Date(time).toString())\n    }\n  }\n}\n```\n\n**Get server time (suspend API):**\n```kotlin\n viewModelScope.launch {\n   val time = ServerTime().execute()\n  \n   when (time) {\n     ServerTime.Result.UNKNOWN_HOST -\u003e { \n       // handle internet not working or error in host                      \n     }\n\n     ServerTime.Result.IO_EXCEPTION -\u003e { \n       // handle io exception                  \n     }\n\n     else -\u003e { \n       // time (milli seconds) was retreived successfully\n       // println(Date(time).toString())\n     }\n   }\n}\n```\n\n# Demo\n\n\u003ca href=\"https://github.com/raheemadamboev/server-time-android/blob/master/extra/app-debug.apk\"\u003eDownload demo\u003c/a\u003e\n\n\u003cimg src=\"https://github.com/raheemadamboev/server-time-android/blob/master/extra/banner.gif\" width=\"200\" height=\"400\"\u003e\n\n# Projects using this library\n\n**GoTest** 250 000+ downloads in \u003ca href=\"https://play.google.com/store/apps/details?id=xyz.teamgravity.gotest\"\u003eGoogle Play Store\u003c/a\u003e\n\n**Buxgalteriya schyotlar rejasi** 50 000+ downloads in \u003ca href=\"https://play.google.com/store/apps/details?id=xyz.teamgravity.uzbekistanaccountingcode\"\u003eGoogle Play Store\u003c/a\u003e\n\n**Irregular Verbs**  25 000+ downloads in \u003ca href=\"https://play.google.com/store/apps/details?id=xyz.teamgravity.irregularverbs\"\u003eGoogle Play Store\u003c/a\u003e\n\n# License\n\n```xml\nDesigned and developed by raheemadamboev (Raheem) 2022.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraheemadamboev%2Fserver-time-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraheemadamboev%2Fserver-time-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraheemadamboev%2Fserver-time-android/lists"}