Re: date formatting question

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: date formatting question
Date: 2008-07-03 10:27:52
Message-ID: 486CA9A8.5080502@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

richard terry wrote:
> I'm using gambas to save some data to the database, and use the date from a
> textbox to write to the database in format 'dd/mm/yyyy', however when I look
> at the database using pgadmin3 , the date is stored as eg 2008/10/02
> yyyy/dd/mm.
>
> If I re-display it with a formatting option like:
> Format(referral.date, "dd/mm/yyyy") then it looks ok in my program
>
> does it matter that is 'round the wrong way' in the database, or is there some
> way to tell the database to do it the other way around.

Actually; that is NOT how a date is stored in the database; what you see
is the default format being applied:

http://www.postgresql.org/docs/8.3/interactive/runtime-config-client.html#GUC-DATESTYLE

You can (perhaps you'll need more than one):
1) change the default datestyle in postgressql.conf
2) change datestyle with every connection "set datestyle ..."
3) change default datestyle in pgadmin3 (maybe; I don't use this).

Frank

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Miernik 2008-07-04 07:17:11 how to create a function in plpgsql which picks the name of a variable which is NULL out of a list of variables?
Previous Message Netzach 2008-07-03 09:29:56 Re: Calculating repeating events - functionality lost with the demise of tinterval ?