Re: date format and postgreSQL...
| From: | Alexey Borzov | Date: | Fri, 10 Nov 2000 08:16:19 +0000 |
| Subject: | Re: date format and postgreSQL... | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-24631@lists.php.net to get a copy of this message | ||
Greetings, Javier!
The best solution is to use ISO-8601 format exclusively. That is
'yyyy-mm-dd'. You should convert you date to iso when you insert it, to
prevent ambiguity with dates like '2/10/2000'.
Before doing your SELECT, issue
SET DATESTYLE TO 'iso'
and output will be in iso-8601 as well...
At 09.11.2000, 11:10, you wrote:
JMM> I'm using PostgreSQL, and I have problems to understend date management...
JMM> I execute the next insert commands...
JMM> insert into test values ('any1', '2/11/2000')
JMM> insert into test values ('any1', '2/10/2000')
JMM> insert into test values ('any1', '20/10/2000')
JMM> But when I do a select * from test:
JMM> any|02-11-2000
JMM> any|02-10-2000
JMM> any|10-20-2000
JMM> And, When I'm reading my recorset I have a date with "dd-mm-yyyy" and
JMM> another date with "mm-dd-yyyy"...
JMM> What's going on?...
--
Yours, Alexey V. Borzov, Webmaster of RDW