Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the current UTC time, optionally offset by a given timespan.
The current UTC time will stay the same across all uses of now()
in a single query statement, even if there's technically a small time difference between when each now()
runs.
now(
[ offset ])
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
offset | timespan |
A timespan to add to the current UTC clock time. The default value is 0. |
The current UTC clock time, plus the offset time if provided, as a datetime
.
print now()
print now(-2d)
The following example shows the time elapsed since the start of the storm events.
StormEvents
| extend Elapsed=now() - StartTime
| take 10
let T = datatable(label: string, timespanValue: timespan) [
"minute", 60s,
"hour", 1h,
"day", 1d,
"year", 365d
];
T
| extend timeAgo = now() - timespanValue
Output
label | timespanValue | timeAgo |
---|---|---|
year | 365.00:00:00 | 2022-06-19T08:22:54.6623324Z |
day | 1.00:00:00 | 2023-06-18T08:22:54.6623324Z |
hour | 01:00:00 | 2023-06-19T07:22:54.6623324Z |
minute | 00:01:00 | 2023-06-19T08:21:54.6623324Z |
Note
This operation can be accomplished with the ago() function.