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 18:45:26
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: 
> If not to_char, what is the preferred method to convert a timestamp to a
> string?
Your original post showed to_char apparently doing what you wanted, no?
> select to_char(date, 'yyyy-mm-dd') as char, 
>        date 
>   from (select timestamp'2008-01-30 15:06:21.560' as date) sub
> "2008-01-30 15:06:21.560";"2008-01-30 15:06:21.56"
The to_char function returned the timestamp as a character string with
three decimal positions.

In response to

pgsql-hackers by date

Next:From: Roberts, JonDate: 2008-01-31 18:45:41
Subject: Re: timestamp format bug
Previous:From: Roberts, JonDate: 2008-01-31 18:34:59
Subject: Re: timestamp format bug

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