X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E30B5D1DA5F for ; Mon, 9 Feb 2004 16:46:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 10854-10 for ; Mon, 9 Feb 2004 12:45:54 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3EFCCD1C9B4 for ; Mon, 9 Feb 2004 12:45:54 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i19Gji1Y010061 for ; Mon, 9 Feb 2004 16:45:44 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i19GL6tR004329 for pgsql-sql@postgresql.org; Mon, 9 Feb 2004 16:21:06 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.sql Subject: Re: timestamptz - problems Date: Mon, 09 Feb 2004 11:18:55 -0500 Organization: cbbrowne Computing Inc Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:tp3YxJm8C2Ct1SW/LvDc2Qf75Ck= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/86 X-Sequence-Number: 16777 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