Date Format Inquiry

Started by Command Prompt, Inc.over 24 years ago2 messagesgeneral
Jump to latest
#1Command Prompt, Inc.
pgsql-general@commandprompt.com

Good day,

In the on-line documentation, it's mentioned that there is an available
date format of the form YYDDD, where YY is the year, and DDD is the day of
the year.

The example given is '99008', which does show up correctly:

lx=# SELECT date('99008');
date
------------
1999-01-08
(1 row)

In fact, it shows up correctly up until after I try to specify past
january, but above the 31st day it fails.

lx=# SELECT date('99031');
date
------------
1999-01-31
(1 row)

lx=# SELECT date('99032');
ERROR: Bad date external representation '99032'

Is this format no longer maintained, or am I missing something? ;)

Regards,
Jw.
--
jlx@commandprompt.com
by way of pgsql-general@commandprompt.com

#2Allan Engelhardt
allane@cybaea.com
In reply to: Command Prompt, Inc. (#1)
Re: Date Format Inquiry

pgsql-general@commandprompt.com wrote:

In fact, it shows up correctly up until after I try to specify past
january, but above the 31st day it fails.

lx=# SELECT date('99031');
date
------------
1999-01-31
(1 row)

lx=# SELECT date('99032');
ERROR: Bad date external representation '99032'

Is this format no longer maintained, or am I missing something? ;)

select '1999.032'::DATE;

still works and is probably more sound........

Allan.