【问题标题】:Kusto Query to extract mmm-yyyy from timestamp columnKusto Query 从时间戳列中提取 mmm-yyyy
【发布时间】:2020-06-05 01:55:28
【问题描述】:

我有一个包含日期时间值的时间戳列。我想从中提取年月。 例如:如果时间戳是 2020-02-19T13:42:51.393Z,我想要的输出是 2020 年 2 月。

我尝试查看https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/format-datetimefunction,一个月内什么都没有。

提前致谢。

【问题讨论】:

    标签: azure-data-explorer kql


    【解决方案1】:

    你可以试试这样的:

    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))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-02
      • 1970-01-01
      • 1970-01-01
      • 2018-11-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多