Forum: Managing VoltDB

Post: Is it possible to set TimeZone while storing date time?

Is it possible to set TimeZone while storing date time?
interntest
May 21, 2015
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.
bballard
May 21, 2015
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.
interntest
May 22, 2015
Thank You.