Generate consecutive time points with the same interval
Example 1: Interval days
Generate a 31day date sequence between 20200301 and 20210330 in the Excel file, and the result is shown in the following figure:
Write SPL script:
A 

1 
=periods("20200301","20210330",31) 
2 
=T("e:/work/book1.xlsx",A1) 
A1 Generate a date sequence with an interval of 31 days between 20200301 and 20210330
A2 Save A1 to the file book1.xlsx
Example 2: Interval seconds
Generate a time series with an interval of 2 hours between 08:00 and 20:00 in the Excel file, and the results are shown in the following figure:
Write SPL script:
A 

1 
=periods@s("08:00:00","20:00:00",7200) 
2 
=T("e:/work/book1.xlsx",A1) 
A1 Generate a time series with an interval of 2 hours between 08:00 and 20:00. The option @s means the interval time unit is seconds.
A2 Save A1 to the file book1.xlsx
Example 3: Interval months
Generate a date series with an interval of 1 month between 20180331 and 20190301 in the Excel file, and the result is shown in the following figure:
Write SPL script:
A 

1 
=periods@mox("20180331","20190301",1) 
2 
=T("e:/work/book1.xlsx",A1) 
A1 Generate a date sequence with an interval of 1 month between 20180331 and 20190301, the option @m means the interval time unit is month, x means that the endpoint 20190301 is not included, and o means that the time does not need to be adjusted to the starting point of the time. If this option is not added, it will be adjusted to the 1st of each month from the second time point.
A2 Save A1 to the file book1.xlsx
In addition, ten days, quarters, and years can be used as the interval time unit. You can refer to the help of the periods function.
Chinese version