Re: timestamptz - problems - Mailing list pgsql-sql

From Christopher Browne
Subject Re: timestamptz - problems
Date
Msg-id m3y8rcb500.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to timestamptz - problems  ("Mark Roberts" <RoberM1@gosh.nhs.uk>)
List pgsql-sql
Oops! RoberM1@gosh.nhs.uk ("Mark Roberts") was seen spray-painting on a wall:
> Hi im using 'timestamptz' in a function called: 'getdate' to enter
> the start and finish time into a db field, however the date appears
> to be inserted into the db in a random format, i wish for it to only
> be entered into the db as DD-MM-YYYY (European,UK). I understand
> this is probably a very simple problem to resolve but thus far I
> have failed, can anyone plz help.

It seems to me that you're asking the wrong question.

The data type you should normally use for handling timestamps is
"timestamptz," which records the date, time and time zone.

It is certainly _NOT_ inserted in a "random format;" there is NO
ambiguity about what the date and time types in PostgreSQL store in
the database.

What _might_ vary is how a date happens to be _displayed_, and that is
something that you might reasonably want to control.
-- 
wm(X,Y):-write(X),write('@'),write(Y). wm('aa454','freenet.carleton.ca').
http://www3.sympatico.ca/cbbrowne/x.html
This Bloody Century
"Early this century there was a worldwide socialist revolution. The
great battles were then between International Socialism, National
Socialism, and Democratic Socialism. Democratic Socialism won because
the inertia of democracy prevented the socialism from doing as much
damage here. Capitalism first reemerged from the ashes of National
Socialism, in Germany and Japan. It is now reemerging from the ashes
of International Socialism.  Next?

After all, inertia works both ways..."
-- Mark Miller


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Implementation of a bag pattern using rules
Next
From: Tom Lane
Date:
Subject: Re: Index not used - now me