No announcement yet.

Is it possible to set TimeZone while storing date time?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to set TimeZone while storing date time?

    Voltdb allows time to be stored as bigint if it is in the Unix time format. However when retrieving back value as date, it by default displays it as GMT time. Is it possible to display the same in other timezone.

  • #2
    TIMESTAMP columns in VoltDB are stored as a long value representing microseconds since posix epoch in the UTC timezone. There is no SQL function to convert to a given timezone. There is no default timezone setting in sqlcmd, timestamp values will always be displayed in UTC timezone.

    If you are building a client application, each client has equivalent data types, but the value is always in UTC timezone. Each language has ways to convert the values to other timezones. For example, in java you might use VoltTableRow.getTimestampAsSqlTimestamp(0) to get the value of a timestamp row. You could then use DateFormat to convert this to a particular timezone.


    • #3
      Thank You.