Parse Postgres interval columns. v4.0.2 (stable) — mature, low-churn single-purpose package with TypeScript declarations. Parses default Postgres interval string format (e.g. '01:02:03') and returns an object with months, days, hours, minutes, seconds, milliseconds. Provides toPostgres(), toISOString(), toISOStringShort() methods. No validation — expects well-formed input. Minimal dependencies, focused on performance. Current version drops Node <12.
npm install postgres-intervalNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a Postgres interval string and demonstrates all output methods.
Upgrade Node to version 12 or later.
Ensure input strings follow Postgres default interval format, e.g. 'HH:MM:SS' or '1 day 2 hours 3 minutes 4 seconds'.
Set `intervalstyle` to `default` in Postgres before querying intervals.
Use interval.toISOString() instead.
Use import parse from 'postgres-interval' instead.
No dependency data recorded yet.