Date formats

This page explains how the NXLog Platform logs database handles various date formats. When sending data from NXLog Agent to NXLog Platform, use the supported date formats to avoid saving records with an incorrect timestamp.

Datetime fields

The NXLog Platform logs database stores dates as DateTime64 with nanoseconds (9) precision. Therefore, datetime fields must be in nanoseconds since the epoch. Datetime fields using other precisions, such as milliseconds or microseconds, result in an incorrect date.

String fields containing dates

During parsing, the logs database tries to determine the best data type for each field. For string fields containing dates, the logs database uses best_effort parsing, which supports all ISO 8601 date and time formats, including the following:

YYYY-MM-DD hh:mm:ss
YYYY-MM-DDThh:mm:ssTZ
YYYY-MM-DDThh:mm:ss.sTZ
YYYY-MM-DD hh:mm:ssTZ
YYYY-MM-DD hh:mm:ss.sTZ
YYYY-MM-DDThh:mm:ssUTC
YYYY-MM-DDThh:mm:ss.sUTC
YYYY-MM-DD hh:mm:ssUTC
YYYY-MM-DD hh:mm:ss.sUTC

See also Type inference for paths in the ClickHouse documentation.

You can change the default date format in NXLog Agent by setting the DateFormat global directive. Refer to Timestamps for more information on how NXLog Agent processes dates.