SQL Date/Time functionality for Zol, a TypeScript ORM for PostgreSQL. Current stable version is 0.5.1. Provides types and utilities to handle date and time operations in SQL queries, with seamless integration into Zol's query builder. Ships TypeScript declarations. Useful for PostgreSQL-specific date/time functions, ISO strings, and intervals.
npm install zol-datetimeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a LocalDate and using it in a Zol template literal to generate a parameterized SQL query.
Upgrade SQL column types and ensure database expects ISO format.
Replace `import ZolDatetime from 'zol-datetime'` with `import { LocalDate, LocalDateTime, ... } from 'zol-datetime'`.Convert native Date to LocalDate: `const localDate = LocalDate.ofInstant(date.toInstant())`.
Ensure all date strings conform to ISO 8601 before passing to parse.
Use `import { LocalDate } from 'zol-datetime'` instead of `require('js-joda').LocalDate`.Use `LocalDate`, `LocalDateTime`, or `Instant` from `zol-datetime`.
Use `LocalDateTime.parse` for full datetime strings, or truncate to date part.