Re: time format

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: ivan <iv(at)psycho(dot)pl>, Kurt Roeckx <Q(at)ping(dot)be>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: time format
Date: 2004-01-04 12:54:25
Message-ID: 200401040954.25708.martin@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

El Sáb 03 Ene 2004 18:20, ivan escribió:
> ok, bat each time where i want to do select .. a nie tu use to_char,
> but it should be in function timestamp_out to convert time to string
> it would be easer and faster.

Look deeper into what Christopher said and use casting to get the right
output:

prueba=> select now();
now
-------------------------------
2004-01-04 09:53:41.131079-03
(1 row)

prueba=> select now()::timestamp(0);
now
---------------------
2004-01-04 09:53:43
(1 row)

Get the difference?

--
09:52:01 up 39 days, 16:08, 2 users, load average: 0.60, 0.71, 0.72
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2004-01-04 14:50:14 Re: ecpg's minor bug
Previous Message Mark Kirkwood 2004-01-04 07:22:10 Re: psql \d option list overloaded