Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.3 KB

endofday-function.md

File metadata and controls

45 lines (32 loc) · 1.3 KB
title description ms.reviewer ms.topic ms.date
endofday()
Learn how to use the endofday() function to return a datetime representing the end of the day for the given date value.
alexans
reference
12/11/2022

endofday()

Returns the end of the day containing the date, shifted by an offset, if provided.

Syntax

endofday(date [, offset])

[!INCLUDE syntax-conventions-note]

Parameters

Name Type Required Description
date datetime ✔️ The date to find the end of.
offset int The number of offset days from date. Default is 0.

Returns

A datetime representing the end of the day for the given date value, with the offset, if specified.

Example

[!div class="nextstepaction"] Run the query

  range offset from -1 to 1 step 1
 | project dayEnd = endofday(datetime(2017-01-01 10:10:17), offset) 

Output

dayEnd
2016-12-31 23:59:59.9999999
2017-01-01 23:59:59.9999999
2017-01-02 23:59:59.9999999