Hi all,
starting with 7.2, now() returns a time with milliseconds. If extracted
from the db and displayed verbatim, it shows up as
'2002-02-05 10:59:36.717176+02'.

Unfortunately, I have a lot of code that displays the date/time directly
from the db on a web page without any to_char transformation and now
that is quite harder to understand. Is there any way to have an implicit
formatting back that trims the milliseconds on a per-connection
variable?

-- 
Alessio F. Bragadini		alessio@albourne.com
APL Financial Services		http://village.albourne.com
Nicosia, Cyprus		 	phone: +357-22-755750

"It is more complicated than you think"
		-- The Eighth Networking Truth from RFC 1925


05 Feb 2002 14:19:26 +0200
Alessio Bragadini <alessio@albourne.com>
Display of TIMESTAMP in 7.2

Instead of using now(), you could use timenow(), which displays the date 
and time without the microseconds. 

There's stuff on this in the manual, section 3.4 of the 7.1 documentation.

J


Alessio Bragadini wrote:

> Hi all,
> starting with 7.2, now() returns a time with milliseconds. If extracted
> from the db and displayed verbatim, it shows up as
> '2002-02-05 10:59:36.717176+02'.
> 
> Unfortunately, I have a lot of code that displays the date/time directly
> from the db on a web page without any to_char transformation and now
> that is quite harder to understand. Is there any way to have an implicit
> formatting back that trims the milliseconds on a per-connection
> variable?
> 


Tue, 05 Feb 2002 10:37:45 -0500
J Smith <dark_panda@hushmail.com>
Re: Display of TIMESTAMP in 7.2
Alessio Bragadini <alessio@albourne.com> writes:
> starting with 7.2, now() returns a time with milliseconds. If extracted
> from the db and displayed verbatim, it shows up as
> '2002-02-05 10:59:36.717176+02'.

Use to_char if you want to control the formatting precisely.  Or
replace now() with CURRENT_TIMESTAMP(0) (which not only does what
you want, but is standards-compliant).

			regards, tom lane

Tue, 05 Feb 2002 11:01:45 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Display of TIMESTAMP in 7.2 
On Tue, 2002-02-05 at 18:01, Tom Lane wrote:

> Use to_char if you want to control the formatting precisely.  Or
> replace now() with CURRENT_TIMESTAMP(0) (which not only does what
> you want, but is standards-compliant).

I did try current_timestamp() but not current_timestamp(0)...

Thank you very much.

-- 
Alessio F. Bragadini		alessio@albourne.com
APL Financial Services		http://village.albourne.com
Nicosia, Cyprus		 	phone: +357-22-755750

"It is more complicated than you think"
		-- The Eighth Networking Truth from RFC 1925


05 Feb 2002 18:06:57 +0200
Alessio Bragadini <alessio@albourne.com>
Re: Display of TIMESTAMP in 7.2
Try using CURRENT_TIMESTAMP instead of now() maybe?

Chris


> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Alessio
> Bragadini
> Sent: Tuesday, 5 February 2002 8:19 PM
> To: PostgreSQL Hackers
> Subject: [HACKERS] Display of TIMESTAMP in 7.2
> 
> 
> Hi all,
> starting with 7.2, now() returns a time with milliseconds. If extracted
> from the db and displayed verbatim, it shows up as
> '2002-02-05 10:59:36.717176+02'.
> 
> Unfortunately, I have a lot of code that displays the date/time directly
> from the db on a web page without any to_char transformation and now
> that is quite harder to understand. Is there any way to have an implicit
> formatting back that trims the milliseconds on a per-connection
> variable?
> 
> -- 
> Alessio F. Bragadini		alessio@albourne.com
> APL Financial Services		http://village.albourne.com
> Nicosia, Cyprus		 	phone: +357-22-755750
> 
> "It is more complicated than you think"
> 		-- The Eighth Networking Truth from RFC 1925
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 


Wed, 6 Feb 2002 10:03:21 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: Display of TIMESTAMP in 7.2