Skip to content

toIso8601DateTime - Format a timestamp to Iso 8601

Deprecated - Please use formatTimestamp

toIso8601DateTime automatically converts a given timestamp into ISO 8601 standard format. This format looks like this: 2023-08-11T07:29:17.634Z

This function supports nanosecond output precision.

Syntax

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

toIso8601DateTime(timestamp: timestamp): string
timestamp: timestamp.toIso8601DateTime(): string

Arguments

NameTypeRequiredDescription
timestamptimestamptrueThe timestamp to be formatted in ISO 8601

Example - Basic usage

Converting a timestamp is a simple operation:

create formatted_ts from toIso8601DateTime($m.timestamp)
create formatted_ts from $m.timestamp.toIso8601DateTime()