Power Query
Search…
List.DateTimes

List.DateTimes

Generates a list of datetime values given an initial value, count, and incremental duration value.
function (start as datetime, count as number, step as duration) as list

Description

Returns a list of datetime values of size count, starting at start. The given increment, step, is a duration value that is added to every value.

Category

List.Generators

Examples

Create a list of 10 values starting from 5 minutes before New Year's Day (#datetime(2011, 12, 31, 23, 55, 0)) incrementing by 1 minute (#duration(0, 0, 1, 0)).
1
List.DateTimes(#datetime(2011, 12, 31, 23, 55, 0), 10, #duration(0, 0, 1, 0))
Copied!
{
1
#datetime(2011, 12, 31, 23, 55, 0),
2
#datetime(2011, 12, 31, 23, 56, 0),
3
#datetime(2011, 12, 31, 23, 57, 0),
4
#datetime(2011, 12, 31, 23, 58, 0),
5
#datetime(2011, 12, 31, 23, 59, 0),
6
#datetime(2012, 1, 1, 0, 0, 0),
7
#datetime(2012, 1, 1, 0, 1, 0),
8
#datetime(2012, 1, 1, 0, 2, 0),
9
#datetime(2012, 1, 1, 0, 3, 0),
10
#datetime(2012, 1, 1, 0, 4, 0)
11
}
Copied!
Last modified 3yr ago