[racket] making postgresql timestamp

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Sun May 5 20:46:56 EDT 2013

On 05/04/2013 01:22 PM, Kejia柯嘉 wrote:
> Hi,
>
> How should I construct a postgresql timestamp in terms of current time?
>
> Thanks.

On the Racket side:

   (require db db/util/datetime (prefix-in srfi: srfi/19))
   (srfi-date->sql-timestamp-tz (srfi:current-date))

On the server side:

   (define c (postgresql-connect ___))
   (query-value c "select now()")

Ryan



Posted on the users mailing list.