Gem 一覧へ戻る
An interval datatype for rust's PostgreSQL driver.
- star 数
- 9
- watcher 数
- 0
- fork 数
- 11
- issue 数
- 5
- 最終更新
- 2026/06/15
An interval datatype for rust's PostgreSQL driver.
A interval type for the postgres driver.
There is a separate document on how to contribute to this repo here
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); let interval = Interval::from_std_duration( std::time::Duration::from_secs(3_661) ).unwrap(); assert_eq!(Interval::new(0, 0, 3_661_000_000), interval); }