OpenBI Docs Buy

DateTime.LocalNow

The computer's date and time right now, without a time zone.

Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

DateTime.LocalNow() as datetime

It takes no parameters.

Returns

datetime. What the computer's clock says now.

Remarks

  • The answer is the clock of the computer that runs the query: the studio's on your desk, the server's when a model refreshes there. Two calls in one query may differ; use DateTime.FixedLocalNow when every row must see the same moment.
  • A query that reads the clock gives a new answer at every refresh.

Examples

Now

DateTime.LocalNow()
#datetime(2026, 11, 8, 15, 42, 28)

The date a week ago

Date.AddDays(DateTime.Date(DateTime.LocalNow()), -7)
#date(2026, 11, 1)

DateTime.FixedLocalNow, DateTimeZone.LocalNow, DateTimeZone.UtcNow.

Last updated · OpenBI Studio 0.3.79