Date and time functions

Date and time functions functions for Power Query M language.

Functions

FunctionDescription
#datetimeGenerates a date and time value using numerical inputs for the year, month, day, hour, minute, and (fractional) second. If any of the following conditions are not met, an error will be triggered: - T...
DateTime.AddZoneIncludes timezone details to the given dateTime value. The timezone information consists of timezoneHours along with a possible addition of timezoneMinutes, indicating the preferred deviation from UTC...
DateTime.DateThis function retrieves the date portion of a dateTime, date, datetime, or datetimezone value.
DateTime.FixedLocalNowThis function returns a specific datetime value that represents the current date and time on the system. This value remains constant and will not vary with multiple calls. In contrast, the DateTime.Lo...
DateTime.FromThis function retrieves a datetime value based on the input provided. You may also specify a cultural format (e.g. "en-US"). If the input is empty, the function will return null. If the input is alrea...
DateTime.FromFileTimeThis function takes the fileTime value and converts it into a datetime value in the local time zone. The fileTime value is a Windows file time value that calculates the number of intervals in 100-nano...
DateTime.FromTextThis function creates a date and time value from a text representation provided as input. Optionally, additional properties can be specified using a record parameter named options. The options record ...
DateTime.IsInCurrentHourIt checks if the provided datetime value dateTime falls within the current hour based on the current date and time on the system. The input can be a datetime or datetimezone value.
DateTime.IsInCurrentMinuteThis function checks if a specific datetime value (dateTime) falls within the current minute on the system's date and time. The input parameter should be a datetime or datetimezone value.
DateTime.IsInCurrentSecondThis function checks if the provided datetime value occurs during the present second based on the current date and time on the system. It takes a datetime or datetimezone value as input for evaluation...
DateTime.IsInNextHourThis function checks if the provided date and time value, dateTime, falls within the next hour based on the current date and time of the system. It should be noted that the function will return false ...
DateTime.IsInNextMinuteThis function checks if the provided datetime value dateTime falls within the next minute based on the current date and time of the system. Please be aware that when a value from the current minute is...
DateTime.IsInNextNHoursThis function determines if the specified datetime value dateTime falls within the next number of hours based on the current date and time of the system. It should be noted that the function will retu...
DateTime.IsInNextNMinutesThis function checks if the datetime value provided in the variable "dateTime" falls within the next few minutes based on the current date and time of the system. It should be noted that the function ...
DateTime.IsInNextNSecondsThis function determines if the provided datetime value (dateTime) falls within the next specified number of seconds according to the current date and time on the system. It should be noted that the f...
DateTime.IsInNextSecondThis function is used to check if the provided datetime value occurs in the next second based on the current date and time of the system. It should be noted that the function will return false if the ...
DateTime.IsInPreviousHourThis function determines if the dateTime value provided is within the previous hour based on the current date and time of the system. Please note that if the value falls within the current hour, the f...
DateTime.IsInPreviousMinuteThis function determines if the provided datetime value, dateTime, falls within the previous minute based on the current date and time of the system. It should be noted that this function will return ...
DateTime.IsInPreviousNMinutesThis function checks if the specified datetime value dateTime falls within the number of minutes before the current date and time on the system. The function returns false if the dateTime value is wit...
DateTime.IsInPreviousNSecondsThis function determines if the specified dateTime value occurs within the past number of seconds based on the current system date and time. It should be noted that the function will return false if a...
DateTime.IsInPreviousSecondThis function determines if the specified datetime value dateTime is from the second before the current date and time on the system. It is important to note that this function will return false if a v...
DateTime.LocalNowThis function retrieves a datetime value that is set to the current date and time on the system.
DateTime.TimeReturns the time component of the provided datetime value, dateTime.
DateTime.ToRecordThis function will return a record that includes the individual components of the specified datetime value, dateTime.dateTime. The input parameter dateTime.dateTime should be a datetime value from whi...
DateTime.ToTextThe function returns a text representation of the dateTime input. An optional parameter, options, can be included to specify additional properties. The culture parameter is only utilized for older wor...