How to set time zone format

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

How to set time zone format

Post by jdorlon » Mon 14 Dec 2020 14:13

Hello,

I see that there is a Format property on TOraTimeStamp.

I don't see how to set the format globally for a TOraSession or even a TSmartQuery. Is this possible?

Thanks,

John Dorlon

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: How to set time zone format

Post by MaximG » Fri 18 Dec 2020 15:49

Currently ODAC doesn't allow you to specify the format in TOraSession or TOraQuery. We'll try to implement such functionality. Could you send us a sample project or code fragement that we could use for testing?

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: How to set time zone format

Post by jdorlon » Mon 04 Jan 2021 22:13

Well, I know I said TOraSession or TSmartQuery initially, but really, if I could just set it globally, that would work for me.

So I'd just like to do something like:
DefaultTimeZoneFormat := 'TZR'; // (I just made this variable name up)

Then this function in OraCall could be changed to:

Code: Select all

function DefaultOCITimeStampWithTZFormat(Precision: Byte = 6): string;
begin
  if DefaultTimeZoneFormat = '' then
    Result := DefaultOCITimeStampFormat + ' TZH:TZM'
  else
    Result := DefaultOCITimeStampFormat + ' ' + DefaultTimeZoneFormat;
end;
and then TZR would be used everywhere, such as query results, editing data from TDBGrid, etc.

I'm not sure if any other changes would be needed to accomplish this.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: How to set time zone format

Post by MaximG » Mon 11 Jan 2021 14:48

We'll consider implementing this behavior in the next version of our product.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: How to set time zone format

Post by jdorlon » Tue 12 Jan 2021 15:13

Thanks. Here is why it matters:

A user has inserted a timestamp with region, such as:

01.04.2021 12:00:00,0000 Europe/Berlin

Then when editing in a grid with TSmartQuery, it is shown as:

01.04.2021 12:00:00,0000 +02:00

Which is fine, but after editing, the region information is lost even if queried specifically with 'TZR'. So the user wants to set our application to use TZR instead of TZH:TZM.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: How to set time zone format

Post by MaximG » Tue 19 Jan 2021 14:38

Thank you for clarifying. We understand the value of this feature and will try to add the ability to set time zone format in a future release.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: How to set time zone format

Post by jdorlon » Wed 23 Feb 2022 16:32

Hello,

It has been more than a year since I made this request. Will you please raise the priority on this?

Thanks

John

Post Reply