Search code examples
timezonetimezone-offsetazure-data-explorertimestamp-with-timezone

Timezone-aware queries in Azure Data Explorer


I use the Azure Data Explorer to store temperature sensor values. The timestamps are in UTC. I want to aggregate these values by day for the last 7 days. Nevertheless, I want to use the local time from where these values came from and aggregate by the timestamps in local time (e.g. midnight would be at 00:00+2h and 22:00UTC). How can I do this with Kusto Query Language in the ADX?


Solution

  • E.g. if you want to provide the timezone UTC+1, you can extend your Kusto query by this:

    | extend Timestamp = Timestamp + 3600s
    

    Your filters for a time range would still need to be provided in UTC though.