DateTimeZone.UtcNow

DateTimeZone

Returns the current date and time in UTC.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

DateTimeZone.UtcNow() as datetimezone

Return Value

datetimezoneThe current UTC date and time.

Remarks

DateTimeZone.UtcNow returns the current date and time in UTC (Coordinated Universal Time) with a +00:00 offset. The value changes each time the query runs, so it cannot be used for reproducible results. It is commonly used for adding refresh timestamps or computing elapsed time relative to a fixed reference point.

Examples

Example 1: Display the current UTC datetime

#table(
    type table [CurrentUTC = datetimezone],
    {{DateTimeZone.UtcNow()}}
)
Result
CurrentUTC
17/15/2024 3:30:00 PM

Example 2: Add a UTC refresh timestamp to Sales

let
    UtcNow = #datetimezone(2024, 7, 15, 15, 30, 0, 0, 0) // DateTimeZone.UtcNow()
in
    Table.AddColumn(
        Table.SelectColumns(
            Table.FirstN(Sales, 3),
            {"OrderID", "CustomerName"}
        ),
        "RefreshUTC", each UtcNow, type datetimezone
    )
Result
OrderID
CustomerName
RefreshUTC
11John Smith7/15/2024 3:30:00 PM
22Sara Johnson7/15/2024 3:30:00 PM
33Mike Davis7/15/2024 3:30:00 PM

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks