Date.EndOfDay

Date.EndOfDay is a Power Query M function that returns the end of the day, preserving time zone information. The function returns the end of the day as a date, datetime, or datetimezone value.

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

Syntax

Date.EndOfDay( dateTime as any ) as any

Description

Returns the end of the day represented by dateTime. Time zone information is preserved.

  • dateTime: A date, datetime, or datetimezone value from from which the end of the day is calculated.

Examples

Get the end of the day for 5/14/2011 05:00:00 PM.

// Output: #datetime( 2011, 5, 14, 23, 59, 59.9999999 )
Date.EndOfDay( #datetime( 2011, 5, 14, 17, 0, 0 ) )

Get the end of the day for 5/17/2011 05:00:00 PM -7:00.

// Output: #datetimezone( 2011, 5, 17, 23, 59, 59.9999999, -7, 0 )
Date.EndOfDay( #datetimezone( 2011, 5, 17, 5, 0, 0, -7, 0 ) )

Other functions related to Date.EndOfDay are:

BI Gorilla Youtube Channel

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-endofday
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.