Morning:
In a question I previously asked I picked up some helpful tips on managing the time zone value in a PL SQL query.
I misunderstood the issue, however.
We have a table where records are being written with dates and times that vary across time zone. These records are being queried by a C# assembly and being sent over to an AXIS service.
When the record gets to the AXIS service, which is hosted in India, the timezone changes to IST.
What I need to do is ensure that the time zone that was in the record is the time zone that is received when the data is queried from any other time zone.
How would I do this? I’m not sure this is so much an Oracle/PL SQL query issue, and if it isn’t please set me straight.
Thanks for any insight.
What data types are being passed around?
Based on your previous question, the data type you are using in Oracle is a
DATE. An OracleDATEdoes not have a time zone associated with it. Unless you are storing a time zone in a separate column that you’re not mentioning, that implies that somewhere else in the stack, aDATEis being read from Oracle (or written to Oracle) with a time zone implied. Whatever component of the stack is implying a time zone would then be the culprit.From an Oracle perspective, the best option is to use a
TIMESTAMP WITH [LOCAL] TIME ZONEdata type so that Oracle knows the time zone. You can then in PL/SQL convert a timestamp in one time zone to a timestamp in another time zone. So you could always get the data in IST or always in GMT/UTC or always in Us/Eastern.