DP-420 · Question #172
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. You need to write a SQL query that will return multiple items. The solution must meet the following requirements…
The correct answer is B. GetCurrentTimestamp(). GetCurrentTimestamp() is a built-in system function in Azure Cosmos DB's SQL API, which returns the current Coordinated Universal Time (UTC) in ISO 8601 format as a string. It can be used directly in a SQL query without any additional effort. This approach minimizes development…
Question
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account. You need to write a SQL query that will return multiple items. The solution must meet the following requirements:
- For each item returned, include the current Coordinated Universal
Time (UTC) date and time, formatted as an ISO 8601 string.
- Minimize development effort.
What should you use?
Options
- Aa user-defined function
- BGetCurrentTimestamp()
- CGetCurrentDateTime()
- DDateTimePart()
How the community answered
(43 responses)- A5% (2)
- B81% (35)
- C12% (5)
- D2% (1)
Explanation
GetCurrentTimestamp() is a built-in system function in Azure Cosmos DB's SQL API, which returns the current Coordinated Universal Time (UTC) in ISO 8601 format as a string. It can be used directly in a SQL query without any additional effort. This approach minimizes development effort because it doesn't require custom logic or user-defined functions.
Topics
Community Discussion
No community discussion yet for this question.