1

I am doing a simple query to retrieve data via ODBC and OdbcDataReader. However, I am not able to determine what the time zone of the data returned is. I have checked every doc and nothing tells me what it is (UTC or local). I tried to look for a setting in SQL Plus and was unable to find something there either.

Does anyone know or know what docs would say? Thanks!

Lance O
  • 53
  • 4

3 Answers3

4

@Madgui is correct with the timezone information. However, there was something else I wanted to mention.

In SQLplus, if you use SELECT ISO8601(IP_TREND_TIME) in your query, you will be returned an ISO8601 string.

If you are doing something in let's say C# and need this as a UTC time, you would have to do the following: DateTime.SpecifyKind(DateTime.Parse(datareader["TREND_TIME"].ToString()).ToUniversalTime(), DateTimeKind.Utc)

DateTim.Parse will return as a LOCAL time, just an FYI which is why you need to to the .ToUniversalTime(). Also, never a bad idea to classify as UTC.

Lance O
  • 53
  • 4
2

In AspenTech IP21 SqlPlus, every timestamps you are relevant to server timezone.
If you are only interested in UTC offset (beware, timezone is not just that), you can ask the server its current time, and do the calculation:

--something like that :
WRITE GETDBTIME;

Also, if you have right on the server, you could call a system command (check the doc for the correct syntax) to have the name of the Timezone:

SYSTEM 'tzutil /g';

Screenshot with result

Madgui
  • 405
  • 2
  • 10
1

The best way to work using timezones in InfoPlus is ever use the function ISO8601(timestamp here). This way you avoid timezones conversions mistakes.