No description
Find a file
2026-01-26 12:19:32 +06:00
.github/workflows ci: enable ci on win 2026-01-26 11:55:10 +06:00
example refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
lib refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
src refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
test test: add custom test-runner 2026-01-23 20:23:19 +06:00
.gitignore refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
build.zig fix: use correct path for win 2026-01-26 12:19:32 +06:00
build.zig.zon chore: clean build.zig.zon 2026-01-26 11:37:08 +06:00
Cargo.lock refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
Cargo.toml refactor: use temporal_rs as pkg 2026-01-26 11:34:26 +06:00
README.md fix: use correct path for win 2026-01-26 12:19:32 +06:00
SPEC.md fix(Instant): align with spec 2026-01-23 23:57:14 +06:00

Temporalz

A Zig library for working with temporal types based on the Temporal Standard.

Temporalz provides Zig bindings to the Rust-based temporal_rs library for handling dates, times, and durations with proper timezone support.

Features

  • Instant - Exact moment in time
  • Duration - Length of time
  • PlainDate - Date without time or timezone
  • PlainTime - Time without date or timezone
  • PlainDateTime - Date and time without timezone
  • PlainYearMonth - Year and month
  • PlainMonthDay - Month and day
  • ZonedDateTime - Date, time, and timezone

Installation

Prerequisites

  • Zig 0.15.2 or later
  • Rust toolchain (only required if prebuilt binaries are not available for your platform)

Add as a Dependency

zig fetch --save=temporalz https://github.com/nurulhudaapon/temporalz/archive/refs/tags/v0.1.2.tar.gz

Use in build.zig

Add temporalz to your executable in build.zig:

const temporalz_dep = b.dependency("temporalz", .{ .target = target, .optimize = optimize });

const exe = b.addExecutable(.{
    .name = "my_app",
    .root_module = b.createModule(.{
        .root_source_file = b.path("src/main.zig"),
        .target = target,
        .optimize = optimize,
        .imports = &.{
            .{ .name = "temporalz", .module = temporalz_dep.module("temporalz") },
        },
    }),
});

Supported Platforms

Prebuilt binaries are available for:

  • aarch64-macos
  • x86_64-macos
  • aarch64-linux-gnu
  • x86_64-linux-gnu
  • x86_64-windows-gnu
  • aarch64-windows-gnu

For unsupported platforms, the library will automatically build from source if the Rust toolchain is installed.

Development

Clone the Repository

git clone https://github.com/nurulhudaapon/temporalz.git
cd temporalz

Build and Run

zig build
zig build run

Run Tests

zig build test

License

MIT