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 |
[!INCLUDENoSQL]
Converts the specified number of ticks to a date and time value.
TicksToDateTime(<numeric_expr>)
Description | |
---|---|
numeric_expr |
A numeric expression. |
Note
For more information on the ISO 8601 format, see ISO 8601.
Returns a UTC date and time string in the ISO 8601 format YYYY-MM-DDThh:mm:ss.fffffffZ
.
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":::
- This function returns
undefined
if the ticks value specified is invalid.