Problem with date and time formats

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
devartuser01
Posts: 1
Joined: Sun 01 May 2011 19:08

Problem with date and time formats

Post by devartuser01 » Sun 01 May 2011 19:19

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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 04 May 2011 11:52

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

Post Reply