todatetime 函数的奇怪行为

Strange behavior with todatetime function

| extend CommandTimeStamp = tostring(customDimensions['CommandTimeStamp'])
| extend originalValue = CommandTimeStamp
| extend constantValue = "11/16/2021 6:04:17 AM +00:00"
| project originalValue, constantValue, equals = (CommandTimeStamp == constantValue), originalTime = CommandTimeStamp, timeColum1 = todatetime(constantValue), timeColum2 = todatetime(CommandTimeStamp)


得到结果:

最后一列是空的。它很奇怪。 有人可以解释一下吗?它阻碍了我们很多。

支持的日期时间格式列表可在此处获得:https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/datetime

您正在使用的格式未包含在该列表中,您可能希望先在源中操作它,或使用查询函数,然后再使用 todatetime()

转换常量字符串文字有效的事实是因为它是在单独的代码路径中处理的,(目前)恰好支持未记录的格式。