Timezone handling

Julien Danjou julien at danjou.info
Thu Jul 25 21:47:35 UTC 2013


On Wed, Jul 24 2013, Russ Tyndall wrote:

> Baring the rest of the issues you might be experiencing with these layered
> systems, "2013-01-01 11:00:00" is considered timezoneless (ie: local zone of
> whatever computer is interpreting it).  If you wish to insert "2013-01-01
> 04:00:00 UTC" the correct spelling is "2013-01-01 04:00:00Z" or "2013-01-01
> 04:00:00+0" which are two spellings of a timestamp in UTC.  Both should be
> recognized by postegresql correctly.
>
> This call to local-time:format-timestring should allow you to produce
> timestamps in the correct zone.
> (local-time:format-timestring nil
>      (local-time:encode-timestamp 0 0 0 12 01 01 2013)
>      :timezone local-time:+utc-zone+)

Thanks, that's helpful. I hoped there was a way to insert a timestamp
with a timezone attached without passing by a conversion to its string
representation, but it seems impossible.

But this seems to work fine, event with DAO as far as I can see.

Cheers,
-- 
Julien Danjou
;; Free Software hacker ; freelance consultant
;; http://julien.danjou.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/postmodern-devel/attachments/20130725/7aa76c9c/attachment.sig>


More information about the postmodern-devel mailing list