Print Thread
Data-aware controls and TIMESTAMP WITH LOCAL TIME ZONE
#38670 08/31/10 03:21 PM
Joined: Mar 2008
Posts: 3
Antwerpen
F
Member
OP Offline
Member
F
Joined: Mar 2008
Posts: 3
Antwerpen
My application uses data-aware controls bound to database fields of type TIMESTAMP WITH LOCAL TIME ZONE.
When I READ data from the db, time values are displayed correctly i.e. in the Session Time Zone.
However, when I POST data to the db, time values are stored as if they were expressed in the Windows Time Zone
(set in the Windows Control Panel), which may differ from the Session Time Zone (set by ALTER SESSION statement in the application).
As a consequence, when the user modifies the minutes of a timestamp only and posts the changes,
the hours are changed as well.

Example:
Windows Time Zone = GMT + 2:00, Session Time Zone = GMT + 4:00
Database field contains time portion 13:00 GMT
Read from db -> data-aware control correctly displays 17:00
Edit control: change 17:00 into 17:10
Post -> database field contains 15:10 GMT and data-aware control displays 19:10

What should I do to make this work correctly?

Kind Regards,
Geert.

Re: Data-aware controls and TIMESTAMP WITH LOCAL TIME ZONE
FastJavelin #38671 09/01/10 10:19 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
What is the value of the TOracleSession.Preferences.TimeStampAsString property? If set to True, timestamps are read and written in the string representation as defined in the NLS_TIMESTAMP_FORMAT or NLS_TIMESTAMP_TZ_FORMAT registry settings. If set to False, timestamps are read and written as standard date values.


Marco Kalter
Allround Automations
Re: Data-aware controls and TIMESTAMP WITH LOCAL TIME ZONE
Marco Kalter #38690 09/06/10 08:20 AM
Joined: Mar 2008
Posts: 3
Antwerpen
F
Member
OP Offline
Member
F
Joined: Mar 2008
Posts: 3
Antwerpen
TOracleSession.Preferences.TimeStampsAsString = FALSE (default value);
when I set it to TRUE, I get an error when loading a db record:
Could not convert variant of type (string) into type (double)

Re: Data-aware controls and TIMESTAMP WITH LOCAL TIME ZONE
FastJavelin #57429 01/12/18 09:29 PM
Joined: Jun 2006
Posts: 27
Albania, Tirana
A
Member
Offline
Member
A
Joined: Jun 2006
Posts: 27
Albania, Tirana
Hello,

I made use of TOracleSession.TimestampAsString:=True
and in an TOracle Dataset tried:

select
SYSTIMESTAMP as timestamp_sts
from dual

and got the timestamp as widestring.

The problem is that it comes in format:
12-JAN-18 10.26.23.350000 PM +01:00

Is there any way to control the format ?
Something that can replace the TDateTime's DisplayFormat?

best regards,
Altin


Re: Data-aware controls and TIMESTAMP WITH LOCAL TIME ZONE
altink #57430 01/13/18 10:28 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
The timestamp format is controlled by the NLS_TIMESTAMP_FORMAT and NLS_TIMESTAMP_TZ_FORMAT settings of your Oracle Session.

You can set the formats in the Oracle Registry, in environment variables, or you can execute ALTER SESSION statements in your application.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.025s Queries: 14 (0.005s) Memory: 2.5182 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-19 20:40:47 UTC
Valid HTML 5 and Valid CSS