# HG changeset patch # User Adam Chlipala # Date 1293285505 18000 # Node ID 8301ee4ab58c21575bbc58cacda0f4931d361ac0 # Parent 1595a738e4e954227390052931bc66b05f60e8f8 Include microseconds in uw_Basis_sqlifyTime() output diff -r 1595a738e4e9 -r 8301ee4ab58c src/c/urweb.c --- a/src/c/urweb.c Fri Dec 24 18:55:13 2010 -0500 +++ b/src/c/urweb.c Sat Dec 25 08:58:25 2010 -0500 @@ -2516,8 +2516,13 @@ if (localtime_r(&t.seconds, &stm)) { s = uw_malloc(ctx, TIMES_MAX); len = strftime(s, TIMES_MAX, TIME_FMT_PG, &stm); - r = uw_malloc(ctx, len + 14); - sprintf(r, "'%s'::timestamp", s); + if (t.microseconds) { + r = uw_malloc(ctx, len + 21); + sprintf(r, "'%s.%06u'::timestamp", s, t.microseconds); + } else { + r = uw_malloc(ctx, len + 14); + sprintf(r, "'%s'::timestamp", s); + } return r; } else return "";