0

I have columns in Sybase IQ with data type as "timestamp". I wonder how do I make the timestamp type columns to show for different timezones when doing queries, i.e. in Aqua Data Studio? Or how do I know what is the timezone I am getting from the query in Aqua Data Studio? Thanks

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
sxy
  • 187
  • 1
  • 3
  • 10

1 Answers1

1

IQ's timestamp does not store time zone information. The timestamp value is usually (but not always) derived from the Operating System, so that is the time zone for the IQ Server. You can figure out the current time for the system using current timestamp getdate() or now()

If you need the Time zone information, you must handle that on the application side, not db side. You may want to take a look at time_zone_adjustment as it may meet some of your needs.

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
  • 1
    I'd like to add that if you have a data dictionary / schema documentation available for your table, each column should be defined as what timezone it is sourced from...and if it's not you should have someone add to the documentation if at all possible. Hopefully, you're only dealing with 1 timezone per column, and can write your SQL accordingly. – Hotel Oct 15 '13 at 21:07