FROM_UNIXTIME()

Documentation

VoltDB Home » Documentation » Using VoltDB

FROM_UNIXTIME()

FROM_UNIXTIME() — Converts a UNIX time value to a VoltDB timestamp.

Synopsis

FROM_UNIXTIME( integer-expression )

Description

The FROM_UNIXTIME() function converts an integer expression to a VoltDB timestamp, interpreting the integer value as a POSIX time value; that is the number of seconds since the epoch (00:00.00 on January 1, 1970 Consolidated Universal Time). This function is a synonym for TO_TIMESTAMP(second, integer-expression).

Example

The following example inserts a record using FROM_UNIXTIME to convert the first argument, a POSIX time value, into a VoltDB timestamp:

INSERT INTO event (e_when, e_what, e_where) 
       VALUES (FROM_UNIXTIME(?),?,?);