日期和时间函数 (Azure Cosmos DB)Date and time functions (Azure Cosmos DB)

适用于: SQL API

通过日期和时间函数,可以在 Azure Cosmos DB 中执行 DateTime 和时间戳操作。The date and time functions let you perform DateTime and timestamp operations in Azure Cosmos DB.

用于获取日期和时间的函数Functions to obtain the date and time

使用以下标量函数可以获取采用以下三种格式的当前 UTC 日期和时间:一个字符串(符合 ISO 8601 格式)、一个数值时间戳(其值为自 Unix 纪元以来已经过的毫秒数),或另一个数值时间戳(其值为自 Unix 纪元以来已经过的时长 100 纳秒的时钟周期数):The following scalar functions allow you to get the current UTC date and time in three forms: a string which conforms to the ISO 8601 format, a numeric timestamp whose value is the number of milliseconds which have elapsed since the Unix epoch, or numeric ticks whose value is the number of 100 nanosecond ticks which have elapsed since the Unix epoch:

用于处理 DateTime 值的函数Functions to work with DateTime values

以下函数使你可以轻松地处理日期/时间、时间戳和时钟周期值:The following functions allow you to easily manipulate DateTime, timestamp, and tick values:

后续步骤Next steps