Is it possible for PostgreSQL to support mmddyyyy date format?
Is it possible for PostgreSQL to support mmddyyyy date format?
От:
Bernard Barton <bfb21@comcast.net>
Дата:
I'm currently porting an Informix based application to PostgreSQL 8.3. All of the dates processed by the application are in the mmddyyyy format. According to the date input table at the link below, the mmddyyyy format is not listed. The yyyymmdd format is supported, but I'd have to modify a LOT of code to change the format, which I'm trying to avoid. Is there any way to get PG to work with the mmddyyyy date format? I know I can use the to_date function, but again, it would be MUCH simpler if PG worked with this format. -Thanks http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-DATE-TABLE
Re: Is it possible for PostgreSQL to support mmddyyyy date format?
От:
Justin <justin@emproshunts.com>
Дата:
This is from the link
| 1/8/1999 | January 8 in MDY mode; August 1 in DMY mode |
| 1/18/1999 | January 18 in MDY mode; rejected in other modes |
| 01/02/03 | January 2, 2003 in MDY mode; February 1, 2003 in DMY mode; February 3, 2001 in YMD mode |
you can run this
select '01/01/2009'::date, '01-01-2009'::date
You can change the output for the client..
http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DATESTYLE
Bernard Barton wrote:.
I'm currently porting an Informix based application to PostgreSQL 8.3. All of the dates processed by the application are in the mmddyyyy format. According to the date input table at the link below, the mmddyyyy format is not listed. The yyyymmdd format is supported, but I'd have to modify a LOT of code to change the format, which I'm trying to avoid. Is there any way to get PG to work with the mmddyyyy date format? I know I can use the to_date function, but again, it would be MUCH simpler if PG worked with this format. -Thanks http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-DATE-TABLE