Date convertion problem.

Started by Albert Chenalmost 27 years ago2 messagesgeneral
Jump to latest
#1Albert Chen
chen6178@hotmail.com

Hi,

I have a problem about date convertion.
I insert a value which attribute is date, like this:

insert into example values ('19 Mar 1999');

How do I show the date become 1999/3/19?

Thanks in advance,
Albert.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

#2Colin Price (EML)
Colin.Price@eml.ericsson.se
In reply to: Albert Chen (#1)
RE: [GENERAL] Date convertion problem.

To set date styles for your dB (Look for the SET command
at the User guide documentation for a full explanation) :
- At runtime level :
test=> show DATESTYLE;
test=> SET DATESTYLE TO 'ISO';
- At boot up (/etc/rc.d/init.d/postgres) :
Add :
export PGDATESTYLE=ISO
just before executing postmaster ....
- At database level :
$ postgres <options> <database>
- option -e = European
see $ man postgres
- At user level :
Add in to shell startup (Eg .bash_profile) :
export PGDATESTYLE=ISO

To see what format you're getting :
SELECT datetime 'now';
select date 'now';

Show quoted text

-----Original Message-----
From: Albert Chen [mailto:chen6178@hotmail.com]
Sent: Tuesday, July 06, 1999 3:40 AM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] Date convertion problem.

Hi,

I have a problem about date convertion.
I insert a value which attribute is date, like this:

insert into example values ('19 Mar 1999');

How do I show the date become 1999/3/19?

Thanks in advance,
Albert.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com