Oracle TIMESTAMP WITH TIMEZONE named zone vs offset

38,058

I've found that setting the TimeZone and format within ODP.NET when a connection is opened seems to solve this problem:

OracleGlobalization info = conn.GetSessionInfo();
info.TimeZone = "Pacific/Auckland";
info.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM";
info.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR";
conn.SetSessionInfo(info);
Share:
38,058
tobyc
Author by

tobyc

Digital Construction Worker http://twitter.com/tobythecox

Updated on July 09, 2022

Comments

  • tobyc
    tobyc almost 2 years

    In oracle, is the named timezone always stored?

    I have been testing this column within our system, and in some places the timestamp is shown as:

    26-FEB-09 11.36.25.390713 AM +13:00
    

    but other times it's:

    26-FEB-09 11.36.25.390713 AM Pacific/Auckland
    

    If the value is being stored as the former, does that mean the actual timezone is not being stored?

    I worry because if a future date is stored with only an offset we might not be able to determine the actual time in the original timezone, because you can determine a offset from a timezone, but not vice versa.

    Thanks