Skip to main content

toIso8601DateTime

warning
toIso8601DateTime is deprecated. Use formatTimestamp instead.

Description

Returns a timestamp formatted as an ISO 8601 string (e.g. 2023-08-11T07:29:17.634Z). This function supports nanosecond precision.

Syntax

Like many functions in DataPrime, toIso8601DateTime supports two notations, function and method. These interchangeable forms allow flexibility in how you structure expressions.

toIso8601DateTime(timestamp: timestamp): string

Arguments

NameTypeRequiredDescription
timestamptimestamptrueThe timestamp to format in ISO 8601

Example

Use case: Convert a timestamp into ISO 8601 format

Example query

create formatted_ts from toIso8601DateTime($m.timestamp)

Example output

{
"formatted_ts": "2023-08-11T07:29:17.634Z"
}
Was this page helpful?