From: Christopher Browne <cbbrowne@acm.org>
To: pgsql-sql@postgresql.org
Subject: Re: timestamptz - problems
Date: Mon, 09 Feb 2004 11:18:55 -0500
Message-ID: <m3y8rcb500.fsf@wolfe.cbbrowne.com> (raw)
References: <s027a12f.012@smtp.gosh.nhs.uk>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cbbrowne@acm.org
Subject: Re: timestamptz - problems
In-Reply-To: <m3y8rcb500.fsf@wolfe.cbbrowne.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox