你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
make_datetime()
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Creates a datetime scalar value between the specified date and time.
Syntax
make_datetime(
year, month, day)
make_datetime(
year, month, day, hour, minute)
make_datetime(
year, month, day, hour, minute, second)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
year | int |
✔️ | The year value between 0 to 9999. |
month | int |
✔️ | The month value between 1 to 12. |
day | int |
✔️ | The day value between 1 to 28-31, depending on the month. |
hour | int |
The hour value between 0 to 23. | |
minute | int |
The minute value between 0 to 59. | |
second | double | The second value between 0 to 59.9999999. |
Returns
If successful, the result will be a datetime value, otherwise, the result will be null.
Example
print year_month_day = make_datetime(2017,10,01)
Output
year_month_day |
---|
2017-10-01 00:00:00.0000000 |
print year_month_day_hour_minute = make_datetime(2017,10,01,12,10)
Output
year_month_day_hour_minute |
---|
2017-10-01 12:10:00.0000000 |
print year_month_day_hour_minute_second = make_datetime(2017,10,01,12,11,0.1234567)
Output
year_month_day_hour_minute_second |
---|
2017-10-01 12:11:00.1234567 |