This page explains how to use the unixtime_microseconds_todatetime function in APL.
unixtime_microseconds_todatetime
converts a Unix timestamp that is expressed in whole microseconds 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 microseconds (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
eval ts=strftime(_time,"%Y-%m-%dT%H:%M:%S.%6N")
. In APL, the conversion happens with a scalar function, so you can use it inline wherever a datetime
literal is accepted.ANSI SQL users
datetime
, which then supports the full date-time syntax.Name | Type | Description |
---|---|---|
microseconds | int or long | Whole microseconds since the Unix epoch. Fractional input is truncated. |
datetime
value that represents the given epoch microseconds at UTC precision (1 microsecond).
_time | epoch_microseconds | datetime_standard |
---|---|---|
May 15, 12:09:22 | 1,747,303,762 | 2025-05-15T10:09:22Z |
datetime
value.datetime
value.datetime
value.