DateTime.FixedLocalNow

Updated on

DateTime.FixedLocalNow is a Power Query M function that returns a datetime value set to the current date and time on the system, which is fixed and will not change with successive calls.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

DateTime.FixedLocalNow() as datetime

Description

DateTime.FixedLocalNow returns a fixed datetime value set to the current date and time on the system. Unlike DateTime.LocalNow, which may yield different values across successive calls, DateTime.FixedLocalNow provides a constant value during the execution of an expression.

Examples

Let’s see an example of the DateTime.FixedLocal now function. Here’s the output of this function at the moment it was run:

DateTime.FixedLocalNow() 

// At the time of running this query the function returns
// #datetimezone( 2023, 7, 23, 12, 56, 24.0738740)
// represented by: 2023-07-23T12:56:24.0738740

Other functions related to DateTime.FixedLocalNow are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/datetime-fixedlocalnow