nerdexam
Microsoft

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…

Design and implement data models

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)
  • A
    5% (2)
  • B
    81% (35)
  • C
    12% (5)
  • D
    2% (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

#Cosmos DB SQL API#Date and Time Functions#Querying Data#ISO 8601

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice