This page explains how to use the unixtime_seconds_todatetime function in APL.
unixtime_seconds_todatetime
converts a Unix timestamp that is expressed in whole seconds since 1970-01-01 00:00:00 UTC to an APL datetime value.
Use the function whenever you ingest data that stores time as epoch seconds (for example, JSON logs from NGINX or metrics that follow the StatsD line protocol). Converting to datetime
lets you bin, filter, and visualize events with the rest of your time-series data.
Splunk SPL users
unixtime_seconds_todatetime
replaces the combination of eval strftime
/ strptime
that you normally use in Splunk. Pass the epoch value directly and APL returns a datetime
.ANSI SQL users
FROM_UNIXTIME
or TO_TIMESTAMP
. The APL version has the same single-argument signature, returns a full datetime
, and automatically interprets the input as seconds (not milliseconds).Name | Type | Description |
---|---|---|
seconds | int or long | Whole seconds since the Unix epoch. Fractional input is truncated. |
datetime
value that represents the given epoch seconds at UTC precision (1 second).
_time | epoch_seconds | datetime_standard |
---|---|---|
May 15, 12:09:22 | 1,747,303,762 | 2025-05-15T10:09:22Z |
datetime
value.datetime
value.datetime
value.