Page 1 of 1

Problem with date and time formats

Posted: Sun 01 May 2011 19:19
by devartuser01
It appears to me that date and time formating is ignoring my application defined formats. I changed date and time separators, and date and time formats. However, my changes are ignored, and application uses settings from Control Panel Regional Options. Am I wrong to expect that formatting should follow my application defined formats?

Posted: Wed 04 May 2011 11:52
by AlexP
Hello,

To get the specific format of date, you should use the DateFormat specific option like

UniConnection1.SpecificOptions.Values['DateFormat'] := 'MM/DD/YYYY';

This options is avaliable only for the Oracle provider. This options specifies the default date format used when Oracle makes conversionsfrom internal date format to string values and vice versa. So you should use the following SQL statement:

select to_char(trunc(sysdate)) as cur_date from dual