{"id":19484392,"url":"https://github.com/funnygeeker/micropython-easytime","last_synced_at":"2025-10-03T22:36:57.326Z","repository":{"id":96170448,"uuid":"608441295","full_name":"funnygeeker/micropython-easytime","owner":"funnygeeker","description":"A MicroPython library for synchronizing and setting time.  用于同步时间和设置时间的MicroPython库","archived":false,"fork":false,"pushed_at":"2024-04-30T11:26:37.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T00:41:23.147Z","etag":null,"topics":["esp01s","esp32","esp8266","micropython","ntp","ntp-client","rtc","time"],"latest_commit_sha":null,"homepage":"","language":"Python","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/funnygeeker.png","metadata":{"files":{"readme":"README.ZH-CN.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}},"created_at":"2023-03-02T02:40:45.000Z","updated_at":"2024-10-04T15:12:36.000Z","dependencies_parsed_at":"2024-04-30T13:13:49.301Z","dependency_job_id":null,"html_url":"https://github.com/funnygeeker/micropython-easytime","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/funnygeeker/micropython-easytime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnygeeker%2Fmicropython-easytime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnygeeker%2Fmicropython-easytime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnygeeker%2Fmicropython-easytime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnygeeker%2Fmicropython-easytime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funnygeeker","download_url":"https://codeload.github.com/funnygeeker/micropython-easytime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnygeeker%2Fmicropython-easytime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278239870,"owners_count":25954092,"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-10-03T02:00:06.070Z","response_time":53,"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":["esp01s","esp32","esp8266","micropython","ntp","ntp-client","rtc","time"],"created_at":"2024-11-10T20:21:16.945Z","updated_at":"2025-10-03T22:36:57.278Z","avatar_url":"https://github.com/funnygeeker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[English (英语)](./README.md)\n# micropython-easytime\n适用于 micropython 的时间管理模块，可以较为方便地设置、获取或同步时间\n\n### 代码示例\n```python\nfrom lib.easytime import EasyTime\n\n# time_zone 为时区\net = EasyTime(time_zone=8, datetime=(2023, 1, 1, 6, 0, 0, 0, 0))\n\n# 获取当前时间\nprint(et.time())\n# (2023, 1, 1, 6, 0, 0, 0, 226)\n\n# 设置当前时间\nprint(et.time((2023, 1, 1, 6, 1, 0, 0, 0)))\n# None\n\n# 设置当前年份\nprint(et.year(2022))\n# None\n\n# 获取当前年份\nprint(et.year())\n# 2023\n\n# 获取当前月份\nprint(et.month())\n# 1\n\n# 其他的详见源码，以此类推，此处不再举例\n# 从 NTP 时间服务器同步时间（请先连接网络）\n# et.sync()\n```\n\n### 注意事项\n- 时间同步需要连接网络，您可以使用 `micropython-easynetwork` 连接无线网络，也可以用其他的方式。\n- [https://github.com/funnygeeker/micropython-easynetwork](https://github.com/funnygeeker/micropython-easynetwork)\n\n### 参考资料\nGithub - PyClock：[https://github.com/01studio-lab/pyClock](https://github.com/01studio-lab/pyClock)\n\nMicroPython - Docs：[https://docs.micropython.org/en/latest/library/pyb.RTC.html](https://docs.micropython.org/en/latest/library/pyb.RTC.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnygeeker%2Fmicropython-easytime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunnygeeker%2Fmicropython-easytime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnygeeker%2Fmicropython-easytime/lists"}