Hi @Dharshinika-FT ,
Thank you for posting query in Microsoft Q&A Platform and helping me with clarifications on your query.
Azure monitor workbooks basically help us to query log data of various resources in Azure and visualise data for reporting and analysis. KQL query helps us to query this data from log analytics behind the scenes.
In KQL we have a function called now() to get current date and time in UTC. We should use that to get current date and time in UTC and then apply offset based on local time of VM.
For example lets say if our VM local datetime is IST then below KQL query helps to get Current datetime of VM.
Since the difference between UTC and IST is 5hours and 30 mins, here I am using offset to now() as 5.5h(That means 5hours and 30 mins)
query used in above screenshot:
datatable (VMname:string)[
'testVM'
]
| extend UTCtime = now()
| extend ISTtime = now(+5.5h)
Hope this helps. Please let us know if any further queries.
---------------
Please consider hitting Accept Answer
. Accepted answers help community as well.