Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.38 KB

tickstodatetime.md

File metadata and controls

56 lines (38 loc) · 1.38 KB
title titleSuffix description author ms.author ms.reviewer ms.service ms.subservice ms.topic ms.devlang ms.date ms.custom
TicksToDateTime
Azure Cosmos DB for NoSQL
An Azure Cosmos DB for NoSQL system function that returns the number of ticks as a date and time value.
jcodella
jacodel
sidandrews
cosmos-db
nosql
reference
nosql
02/27/2024
query-reference

TicksToDateTime (NoSQL query)

[!INCLUDENoSQL]

Converts the specified number of ticks to a date and time value.

Syntax

TicksToDateTime(<numeric_expr>)

Arguments

Description
numeric_expr A numeric expression.

Note

For more information on the ISO 8601 format, see ISO 8601.

Return types

Returns a UTC date and time string in the ISO 8601 format YYYY-MM-DDThh:mm:ss.fffffffZ.

Examples

The following example converts the ticks to a date and time value.

:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/tickstodatetime/query.sql" highlight="2-4":::

:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/tickstodatetime/result.json":::

Remarks

  • This function returns undefined if the ticks value specified is invalid.

Related content