Updated on 2026-11-06 GMT+08:00

from_unixtime

The from_unixtime function is used to convert a timestamp represented by a numeric UNIX value into a date value.

Syntax

from_unixtime(bigint unixtime)

Parameters

Table 1 Parameter description

Parameter

Mandatory

Type

Description

unixtime

Yes

BIGINT

A timestamp in UNIX format. Represents the timestamp to be converted.

The parameter should be filled with the first ten digits of a normal UNIX format timestamp.

Return Values

Converts the timestamp to a time format and returns a date value of type STRING, in the format yyyy-MM-dd HH:mm:ss, yyyyMMddHHmmss.uuuuuu, or yyyyMMdd.

If the unixtime value is NULL, NULL is returned.

Example Code

  • Example 1
    select from_unixtime(1692149997);

    Returns 2023-08-16 09:39:57.

  • Example 2
    select from_unixtime(NULL);

    Returns NULL.