我有一个带有日期时间值的时间戳列。我想从中提取年月。例如:如果时间戳是2020-02-19T13:42:51.393Z,我想要的输出是2020年2月。
我尝试查看https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/format-datetimefunction,它一个月都没有。
谢谢。
您可以尝试这样的事情:
let months = dynamic({"1":"Jan", "2":"Feb", "3":"Mar"}); // ... add the rest
print dt = datetime(2020-02-19T13:42:51.393Z)
| project s = strcat(months[tostring(getmonth(dt))], "-", getyear(dt))