GetCurrentDateTime (NoSQL query)

APPLIES TO: NoSQL

Returns the current UTC (Coordinated Universal Time) date and time as an ISO 8601 string.

Syntax

GetCurrentDateTime()

Return types

Returns the current UTC date and time string value in the round-trip (ISO 8601) format.

Note

For more information on the round-trip format, see .NET round-trip format. For more information on the ISO 8601 format, see ISO 8601.

Examples

The following example shows how to get the current UTC date and time string.

SELECT VALUE {
    currentUtcDateTime: GetCurrentDateTime()
}
[
  {
    "currentUtcDateTime": "2019-05-03T20:36:17.1234567Z"
  }
]

Remarks

  • This function is nondeterministic.
  • The result returned is UTC (Coordinated Universal Time) with precision of seven digits and an accuracy of 100 nanoseconds.
  • 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.