monthofyear()

使用 版本 下拉選單切換服務。 了解更多關於導航的資訊。
Apply to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel

從 1-12 傳回整數,代表指定年份的月數。

和 monthofyear() 函getmonth()式相等

語法

monthofyear( 日期)

深入瞭解 語法慣例。

參數

姓名 類型 必要 描述
date datetime ✔️ 要尋找月份號碼的日期。

傳回

1-12 的整數,表示指定年份的月數。

範例

print result=monthofyear(datetime("2015-12-14"))

輸出

result
12