All Products
Search
Document Center

Realtime Compute for Apache Flink:FROM_UNIXTIME

Last Updated:Mar 26, 2026

Converts a Unix timestamp (in seconds) to a formatted date-time string.

Limits

This function is supported only in Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 3.0.0 or later.

Syntax

VARCHAR FROM_UNIXTIME(BIGINT unixtime[, VARCHAR format])

Parameters

ParameterData typeRequiredDefaultDescription
unixtimeBIGINTYesA Unix timestamp in seconds since 1970-01-01 00:00:00 UTC.
formatVARCHARNoyyyy-MM-dd HH:mm:ssA Java datetime pattern string that controls the output format. For example, MMdd-yyyy outputs 0915-2017.
If any input parameter is NULL or a parsing error occurs, the function returns NULL.

Examples

The following examples use the input value 1505404800.

Default format

SELECT FROM_UNIXTIME(1505404800);
-- Output: 2017-09-15 00:00:00

Custom format

SELECT FROM_UNIXTIME(1505404800, 'MMdd-yyyy');
-- Output: 0915-2017

NULL input

SELECT FROM_UNIXTIME(1505404800, NULL);
-- Output: NULL