Re: [Pgsql-ayuda] fecha

From: "Ing(dot) Roberto Andrade Fonseca" <randrade(at)abl(dot)com(dot)mx>
To: GRETA OLIVIA CARTEAU HERNANDEZ <gcarteau(at)alumnos(dot)ubiobio(dot)cl>
Cc: Pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: Re: [Pgsql-ayuda] fecha
Date: 2002-09-25 22:58:07
Message-ID: Pine.LNX.4.10.10209251752490.8997-100000@inter.interservice.com.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Hola:

On Wed, 25 Sep 2002, GRETA OLIVIA CARTEAU HERNANDEZ wrote:

> Lo que pasa es que estuve en una base de datos que guardaba la fecha como
> dia/mes/año, pero ahora estoy en otra que la guarda como año/mes/dia...
>
> aunque yo la guarde con el fomato dia/mes/año igual me la da vuelta...
>
> puede ser que el tipo de dato date que tiene en la base de datos el campo,
> tenga alguna opcion de formato.. nose se me ocurre el problema es que no se
> como cambiarla.
>

Postgres la guarda de una sola manera:

Del manual de Postgres:

"
time, timestamp, and interval accept an
optional precision value p which
specifies the number of fractional digits retained in the seconds
field. By default, there is no explicit bound on precision. The
effective limit of precision is determined by the underlying double
precision floating-point number used to store values (in seconds
for interval and
in seconds since 2000-01-01 for timestamp). The
useful range of p is from 0 to about
6 for timestamp, but may be more for interval.
The system will accept p ranging from
0 to 13.
"

Lo cual no debe interesarte (a menos que hagas trabajos muuy precisos).

Como te dice Edgar (saludos Edgar): usa el SET DateStyle TO para lograr la salida que deseas.

Revisa el url que envié:

http://www.postgresql.org/idocs/index.php?datatype-datetime.html

Saludos,

Roberto Andrade Fonseca
randrade(at)abl(dot)com(dot)mx

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fabian Gervan 2002-09-25 23:39:57 Re: [Pgsql-ayuda] fecha
Previous Message Rodrigo Gallardo 2002-09-25 22:45:44 [Pgsql-ayuda] ¿Una FAQ?