{"id":13710452,"url":"https://github.com/rockorager/zeit","last_synced_at":"2025-04-07T09:16:30.391Z","repository":{"id":228042800,"uuid":"773007801","full_name":"rockorager/zeit","owner":"rockorager","description":"a date and time library written in zig. Timezone, DST, and leap second aware","archived":false,"fork":false,"pushed_at":"2025-03-20T14:47:13.000Z","size":103,"stargazers_count":93,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T08:08:02.466Z","etag":null,"topics":["date","datetime","library","time","timezone","zig","zig-package"],"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/rockorager.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":"2024-03-16T13:42:09.000Z","updated_at":"2025-03-27T19:14:47.000Z","dependencies_parsed_at":"2024-07-09T23:47:49.205Z","dependency_job_id":"c16eb3e9-1c65-4a5c-b09d-7fc87606b3d2","html_url":"https://github.com/rockorager/zeit","commit_stats":{"total_commits":71,"total_committers":3,"mean_commits":"23.666666666666668","dds":0.07042253521126762,"last_synced_commit":"4bf983f28b89974bddcbde4ab87eaeffac8c625b"},"previous_names":["rockorager/zeit"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fzeit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fzeit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fzeit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockorager%2Fzeit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockorager","download_url":"https://codeload.github.com/rockorager/zeit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622988,"owners_count":20968575,"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":["date","datetime","library","time","timezone","zig","zig-package"],"created_at":"2024-08-02T23:00:56.414Z","updated_at":"2025-04-07T09:16:30.367Z","avatar_url":"https://github.com/rockorager.png","language":"Zig","funding_links":[],"categories":["Language Essentials"],"sub_categories":["Date, Time and Timezones"],"readme":"# zeit\n\nA time library written in zig.\n\n## Usage\n\n[API Documentation](https://rockorager.github.io/zeit/)\n\n```zig\nconst std = @import(\"std\");\nconst zeit = @import(\"zeit\");\n\npub fn main() void {\n    const allocator = std.heap.page_allocator;\n    var env = try std.process.getEnvMap(allocator);\n    defer env.deinit();\n\n    // Get an instant in time. The default gets \"now\" in UTC\n    const now = try zeit.instant(.{});\n\n    // Load our local timezone. This needs an allocator. Optionally pass in a\n    // *const std.process.EnvMap to support TZ and TZDIR environment variables\n    const local = try zeit.local(alloc, \u0026env);\n\n    // Convert our instant to a new timezone\n    const now_local = now.in(\u0026local);\n\n    // Generate date/time info for this instant\n    const dt = now_local.time();\n\n    // Print it out\n    std.debug.print(\"{}\", .{dt});\n\n    // zeit.Time{\n    //    .year = 2024,\n    //    .month = zeit.Month.mar,\n    //    .day = 16,\n    //    .hour = 8,\n    //    .minute = 38,\n    //    .second = 29,\n    //    .millisecond = 496,\n    //    .microsecond = 706,\n    //    .nanosecond = 64\n    //    .offset = -18000,\n    // }\n\n    // Format using strftime specifier. Format strings are not required to be comptime\n    try dt.strftime(anywriter, \"%Y-%m-%d %H:%M:%S %Z\");\n\n    // Or...golang magic date specifiers. Format strings are not required to be comptime\n    try dt.gofmt(anywriter, \"2006-01-02 15:04:05 MST\");\n\n    // Load an arbitrary location using IANA location syntax. The location name\n    // comes from an enum which will automatically map IANA location names to\n    // Windows names, as needed. Pass an optional EnvMap to support TZDIR\n    const vienna = try zeit.loadTimeZone(alloc, .@\"Europe/Vienna\", \u0026env);\n    defer vienna.deinit();\n\n    // Parse an Instant from an ISO8601 or RFC3339 string\n    const iso = try zeit.instant(.{\n\t.source = .{\n\t    .iso8601 = \"2024-03-16T08:38:29.496-1200\",\n\t},\n    });\n\n    const rfc3339 = try zeit.instant(.{\n\t.source = .{\n\t    .rfc3339 = \"2024-03-16T08:38:29.496706064-1200\",\n\t},\n    });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockorager%2Fzeit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockorager%2Fzeit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockorager%2Fzeit/lists"}