{"id":13710393,"url":"https://github.com/frmdstryr/zig-datetime","last_synced_at":"2025-10-25T18:44:46.879Z","repository":{"id":43077883,"uuid":"229103748","full_name":"frmdstryr/zig-datetime","owner":"frmdstryr","description":"A date and time module for Zig","archived":false,"fork":false,"pushed_at":"2025-04-06T19:59:23.000Z","size":96,"stargazers_count":95,"open_issues_count":4,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T05:44:58.122Z","etag":null,"topics":["zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/frmdstryr.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}},"created_at":"2019-12-19T17:15:38.000Z","updated_at":"2025-04-10T18:04:37.000Z","dependencies_parsed_at":"2023-01-20T07:15:45.747Z","dependency_job_id":"e2c2fab8-e9de-43ed-b860-9398cf7ccefb","html_url":"https://github.com/frmdstryr/zig-datetime","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frmdstryr%2Fzig-datetime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frmdstryr%2Fzig-datetime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frmdstryr%2Fzig-datetime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frmdstryr%2Fzig-datetime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frmdstryr","download_url":"https://codeload.github.com/frmdstryr/zig-datetime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670520,"owners_count":21142901,"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":["zig"],"created_at":"2024-08-02T23:00:55.462Z","updated_at":"2025-10-25T18:44:46.861Z","avatar_url":"https://github.com/frmdstryr.png","language":"Zig","readme":"# Zig Datetime\n\n[![actions](https://github.com/frmdstryr/zig-datetime/actions/workflows/ci.yml/badge.svg)](https://github.com/frmdstryr/zig-datetime/actions)\n[![codecov](https://codecov.io/gh/frmdstryr/zig-datetime/branch/master/graph/badge.svg)](https://codecov.io/gh/frmdstryr/zig-datetime)\n\n\nA datetime module for Zig with an api similar to python's Arrow.\n\n\u003e [!NOTE]\n\u003e DST is now implemeted to the library. Some timezones that relying on islamic calendar for DST might not work yet. It is also possible that we might have skipped some timezones by mistake because there are a lot of timezones.\n\n\u003e [!IMPORTANT]\n\u003e With DST implementation, the `shiftTimezone` method changed and now taking timezone argument passed by value contrary to before that it was passed by pointer.\n\n## Install\n1) Add zig-datetime as a dependency in your `build.zig.zon`:\n\n```bash\nzig fetch --save git+https://github.com/frmdstryr/zig-datetime#master\n```\n\n2) In your `build.zig`, add the `datetime` module as a dependency you your program:\n\n```zig\nconst pg = b.dependency(\"datetime\", .{\n    .target = target,\n    .optimize = optimize,\n});\n\n// the executable from your call to exe_mod.addExecutable\nexe.root_module.addImport(\"datetime\", pg.module(\"datetime\"));\n```\n\n## Example\n\n```zig\n\nconst allocator = std.heap.page_allocator;\nconst date = try Date.create(2019, 12, 25);\nconst next_year = date.shiftDays(7);\nassert(next_year.year == 2020);\nassert(next_year.month == 1);\nassert(next_year.day == 1);\n\n// In UTC\nconst now = Datetime.now();\nconst now_str = try now.formatHttp(allocator);\ndefer allocator.free(now_str);\nstd.debug.warn(\"The time is now: {}\\n\", .{now_str});\n// The time is now: Fri, 20 Dec 2019 22:03:02 UTC\n\n\n```\n","funding_links":[],"categories":["Libraries","Language Essentials"],"sub_categories":["Date, Time and Timezones"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrmdstryr%2Fzig-datetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrmdstryr%2Fzig-datetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrmdstryr%2Fzig-datetime/lists"}