获取日期范围内的纪元时间戳列表?

Get a list of epoch timestamps in a date range?

正在开发网络应用程序。我还没有来自 Web 服务的数据,但我知道数据将包含一个纪元时间戳。我想知道是否有人知道生成连续(随机)纪元时间戳的方法。我使用 freedatagenerator 来满足我的大部分数据生成需求,他们有一种创建纪元时间戳的方法,但不是按顺序。我需要数百个用于测试目的,所以我真的不想进去手工做。

按顺序创建一个怎么样?

var myDates = [Math.floor(Date.now() / 1000)]; //UTC timestamp in seconds
var maxGap = 60; //our maximum time gap is 60 seconds
for(var i = 0; i<100; i++) {
    myDates.push(myDates[i] + Math.floor((Math.random() * maxGap) + 1));
}
//myDates now contains random consecutive integer timestamps in seconds