List.DateTimes
A list of datetimes from a start, a set count of them, each a step from the last.
Group: List. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
List.DateTimes(start as datetime, count as number, step as duration) as list
| Parameter | Type | Description |
|---|---|---|
start | datetime | The first datetime. |
count | number | How many datetimes. |
step | duration | The time between them. |
Returns
list. The datetimes.
Examples
Half-hour delivery slots
List.DateTimes(#datetime(2024, 3, 1, 8, 0, 0), 4, #duration(0, 0, 30, 0))
{#datetime(2024, 3, 1, 8, 0, 0), #datetime(2024, 3, 1, 8, 30, 0), #datetime(2024, 3, 1, 9, 0, 0), #datetime(2024, 3, 1, 9, 30, 0)}