{"id":13710462,"url":"https://github.com/deatil/zig-time","last_synced_at":"2025-10-05T01:45:55.891Z","repository":{"id":241146735,"uuid":"802365592","full_name":"deatil/zig-time","owner":"deatil","description":"A date and time parse and format library for Zig","archived":false,"fork":false,"pushed_at":"2025-08-26T11:30:40.000Z","size":52,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T14:55:36.446Z","etag":null,"topics":["date","datetime","time","zig","zig-time"],"latest_commit_sha":null,"homepage":"https://github.com/deatil/zig-time","language":"Zig","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/deatil.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":"2024-05-18T05:20:20.000Z","updated_at":"2025-08-26T11:30:44.000Z","dependencies_parsed_at":"2025-08-26T13:29:39.713Z","dependency_job_id":"1b167738-e94a-47f6-8355-f56a7e09650e","html_url":"https://github.com/deatil/zig-time","commit_stats":null,"previous_names":["deatil/zig-time"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/deatil/zig-time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/zig-time/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fzig-time/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399609,"owners_count":25980331,"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-04T02:00:05.491Z","response_time":63,"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":["date","datetime","time","zig","zig-time"],"created_at":"2024-08-02T23:00:56.725Z","updated_at":"2025-10-05T01:45:55.879Z","avatar_url":"https://github.com/deatil.png","language":"Zig","readme":"## Zig-time \n\nA date and time parse and format library for Zig.\n\n\n### Env\n\n - Zig \u003e= 0.15.1\n\n\n### Adding zig-time as a dependency\n\nAdd the dependency to your project:\n\n```sh\nzig fetch --save=zig-time git+https://github.com/deatil/zig-time#main\n```\n\nor use local path to add dependency at `build.zig.zon` file\n\n```zig\n.{\n    .dependencies = .{\n        .@\"zig-time\" = .{\n            .path = \"./lib/zig-time\",\n        },\n        ...\n    },\n    ...\n}\n```\n\nAnd the following to your `build.zig` file:\n\n```zig\nconst zig_time_dep = b.dependency(\"zig-time\", .{});\nexe.root_module.addImport(\"zig-time\", zig_time_dep.module(\"zig-time\"));\n```\n\nThe `zig-time` structure can be imported in your application with:\n\n```zig\nconst zig_time = @import(\"zig-time\");\n```\n\n\n### Get Starting\n\n~~~zig\nconst std = @import(\"std\");\nconst time = @import(\"zig-time\");\n\npub fn main() !void {\n    const time_0 = time.now().timestamp();\n    std.debug.print(\"now time: {d} \\n\", .{time_0});\n    \n    // ==========\n    \n    const seed: i64 = 1691879007;\n    const fmt: []const u8 = \"YYYY-MM-DD HH:mm:ss z\";\n    \n    const alloc = std.heap.page_allocator;\n    const instant = time.Time.fromTimestamp(seed).setLoc(time.UTC);\n    const fmtRes = try instant.formatAlloc(alloc, fmt);\n    defer alloc.free(fmtRes);\n    \n    // output: \n    // format time: 2023-08-12 22:23:27 UTC\n    std.debug.print(\"format time: {s} \\n\", .{fmtRes});\n}\n~~~\n\n\n### LICENSE\n\n*  The library LICENSE is `Apache2`, using the library need keep the LICENSE.\n\n\n### Copyright\n\n*  Copyright deatil(https://github.com/deatil).\n","funding_links":[],"categories":["Libraries","Language Essentials"],"sub_categories":["Date, Time and Timezones"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzig-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fzig-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fzig-time/lists"}