0
votes

I have a timestamp column with datetime values. I want to extract year-month from it. For Example: if timestamp is 2020-02-19T13:42:51.393Z, output I want is Feb-2020.

I tried looking at https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/format-datetimefunction, it has nothing for month.

Thanks in advance.

1

1 Answers

3
votes

you could try something like this:

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