New date/time integration for cl-postgres

Chaitanya Gupta mail at chaitanyagupta.com
Mon Feb 18 09:55:39 UTC 2019


Hi,

I created a new date/time integration for cl-postgres.

    https://github.com/chaitanyagupta/cl-postgres-datetime

There's nothing fancy -- it just uses local-time to parse timestamptz
and simple-date for other types (which don't use a timezone).

Why? Because neither local-time nor simple-date alone work well with
all the date/time types that Postgres supports.

local-time's TIMESTAMP is a natural fit for timestamptz, and while
non-timezone types like timestamp and date could be parsed into it,
the user has to remember to always use +UTC-ZONE+ when decoding such a
timestamp (the values of decoded components may mismatch with the
original if the default time zone were different from UTC).

simple-date has no concept of time zones, so while it works well for
every type that doesn't need a timezone, it fails badly when it comes
to timestamptz.

Hope someone finds it useful.

Chaitanya
---
lisper.in
deftask.com



More information about the postmodern-devel mailing list