Skip site navigation (1) Skip section navigation (2)

Re: timestamp format bug

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jon Roberts" <Jon(dot)Roberts(at)asurion(dot)com>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp format bug
Date: 2008-01-31 20:00:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
>>> On Thu, Jan 31, 2008 at 12:34 PM, in message
<1A6E6D554222284AB25ABE3229A92762715526(at)nrtexcus702(dot)int(dot)asurion(dot)com>, "Roberts,
Jon" <Jon(dot)Roberts(at)asurion(dot)com> wrote: 
> doesn't round the zeros off for timestamp
Sorry to have been so slow, but I think this is the crux of it:
A timestamp represents a moment in time, without storing any
precision information.  These timestamp literals represent exactly
the same moment, and therefore have exactly the same internal
timestamp '2008-01-31 12:31:40.50'
timestamp '2008-01-31 12:31:40.500'
timestamp '2008-01-31 12:31:40.500000'
to_char turns that into a string of your chosen format.
I hope that helps.

In response to

pgsql-hackers by date

Next:From: Roberts, JonDate: 2008-01-31 20:29:50
Subject: Re: timestamp format bug
Previous:From: Kevin GrittnerDate: 2008-01-31 19:47:06
Subject: Re: timestamp format bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group