pg_interval_2

Crates.iopg_interval_2
lib.rspg_interval_2
version0.5.2
created_at2026-01-22 03:39:34.365873+00
updated_at2026-01-23 12:07:03.534659+00
descriptionA native PostgreSQL interval type, forked version
homepage
repositoryhttps://github.com/sunng87/rust-postgres-interval
max_upload_size
id2060692
size140,648
Ning Sun (sunng87)

documentation

README

Rust-Postgres-Interval

A interval type for the postgres driver. Forked version.

Crate name on crates.io: pg_interval_2.

Contributing

There is a separate document on how to contribute to this repo here

Overview

Rust-Postgres-Interval is dedicated datatype for the postgres interval type.

extern crate pg_interval;

use pg_interval::Interval;

fn main() {
    let interval = Interval::from_postgres(
        "1 years 1 months 1 days 1 hours"
    ).unwrap();
    let output = interval.to_iso_8601();
    assert_eq!(String::from("P1Y1M1DT1H"), output);
}
Commit count: 146

cargo fmt