Explore Datetime Functions in Power Query M Language, essential for manipulating date and time values. This page provides a comprehensive list and descriptions of Datetime Functions available in the M Language.
Table of contents
Component Functions
| Function | Description |
|---|---|
| DateTime.Date | Returns the date component of the given date, datetime, or datetimezone value. |
| DateTime.Time | Returns the time part of the given datetime value. |
Creation and Conversion Functions
| Function | Description |
|---|---|
| #datetime | Creates a datetime value from numbers representing the year, month, day, hour, minute, and (fractional) second. |
| DateTime.From | Creates a datetime from the given value. |
| DateTime.FromFileTime | Creates a datetime from a 64 bits long number. |
| DateTime.FromText | Creates a datetimezone from local and universal datetime formats. |
| DateTime.ToRecord | Returns a record containing the datetime value’s parts. |
| DateTime.ToText | Returns a textual representation of the datetime value. |
Current Value Functions
| Function | Description |
|---|---|
| DateTime.FixedLocalNow | Retrieves the current date and time based on the local timezone. |
| DateTime.LocalNow | Returns the current date and time in the local timezone. |
Information Functions
| Function | Description |
|---|---|
| DateTime.IsInCurrentHour | Indicates whether this datetime occurs during the current hour. |
| DateTime.IsInCurrentMinute | Indicates whether this datetime occurs during the current minute. |
| DateTime.IsInCurrentSecond | Indicates whether this datetime occurs during the current second. |
| DateTime.IsInNextHour | Indicates whether this datetime occurs during the next hour |
| DateTime.IsInNextMinute | Indicates whether this datetime occurs during the next minute |
| DateTime.IsInNextNHours | Indicates whether this datetime occurs during the next number of hours |
| DateTime.IsInNextNMinutes | Indicates whether this datetime occurs during the next number of minutes |
| DateTime.IsInNextNSeconds | Indicates whether this datetime occurs during the next number of seconds |
| DateTime.IsInNextSecond | Indicates whether this datetime occurs during the next second |
| DateTime.IsInPreviousHour | Indicates whether this datetime occurs during the previous hour |
| DateTime.IsInPreviousMinute | Indicates whether this datetime occurs during the previous minute |
| DateTime.IsInPreviousNHours | Indicates whether this datetime occurs during the previous number of hours |
| DateTime.IsInPreviousNMinutes | Indicates whether this datetime occurs during the previous number of minutes |
| DateTime.IsInPreviousNSeconds | Indicates whether this datetime occurs during the previous number of seconds |
| DateTime.IsInPreviousSecond | Indicates whether this datetime occurs during the previous second |
Timezone Functions
| Function | Description |
|---|---|
| DateTime.AddZone | Adds timezone information to the datetime value. |
2023-2026 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy