[Mono-list] Problem with datetime format and oracle...

Brian Bilbro bbilbro@hotmail.com
Sat, 19 Feb 2005 09:55:06 -0500


What Daniel listed below is a very good solution.  However, you can also 
specify the date format using the TO_DATE and TO_CHAR function.

For example, if you have a date input you are updating in the database:

UPDATE MyTable
SET MyDateField=TO_DATE('12/31/2004','MM/DD/YYYY')

or for retrieving data:

SELECT TO_CHAR(MyDateField,'MM/DD/YYYY')
FROM MyTable


Using those two functions and you can have fine grain controls over the date 
format too.

HTHs,
Brian

----- Original Message ----- 
From: "Daniel Morgan" <danielmorgan@verizon.net>
To: "Hubert FONGARNAND" <hubertf-1@altern.org>
Cc: <mono-list@lists.ximian.com>
Sent: Friday, February 18, 2005 11:51 PM
Subject: Re: [Mono-list] Problem with datetime format and oracle...


> The fix needs to be able to handle situations where the date format could 
> be changed via ALTER SESSION SET NLS_DATE_FORMAT, such as,
>
> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';
>
>
> Hubert FONGARNAND wrote:
>
>>I use mono to deal with an oracle database...
>>the date format of my oracle database is "DD/MM/YY"
>>but mono always send date like "DD/MM/YYYY"
>>my NLS_LANG parameter is : NLS_LANG="AMERICAN_AMERICA.WE8ISO8859P1"