title | titleSuffix | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|---|---|
GetCurrentTicks |
Azure Cosmos DB for NoSQL |
An Azure Cosmos DB for NoSQL system function that returns a nanosecond ticks value. |
jcodella |
jacodel |
sidandrews |
cosmos-db |
nosql |
reference |
nosql |
02/27/2024 |
query-reference |
[!INCLUDENoSQL]
Returns the number of 100-nanosecond ticks that have elapsed since 00:00:00 Thursday, 1 January 1970
.
GetCurrentTicks()
Returns a signed numeric value that represents the current number of 100-nanosecond ticks that have elapsed since the Unix epoch (00:00:00 Thursday, 1 January 1970
).
The following example returns the current time measured in ticks:
:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/getcurrentticks/query.novalidate.sql" highlight="2":::
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/getcurrentticks/result.novalidate.json":::
- This function is nondeterministic.
- The result returned is UTC (Coordinated Universal Time).
- This function doesn't use the index.
- If you need to compare values to the current time, obtain the current time before query execution and use that constant string value in the
WHERE
clause.