随机日期生成器
在任意两个日期之间随机挑日期——用于测试数据、写作提示、安排游戏或惊喜出游日。也可以只选工作日或周末。
- 任意日期范围
- 只选工作日或周末
- 最多 50 个日期
随机日期 API
以 JSON 获取随机日期结果。接口只读,少量使用无需 API 密钥,并支持跨域请求。
GET
/api/v1/tools/random-datecurl https://randnext.com/api/v1/tools/random-date?start=2026-01-01&end=2026-12-31&count=3参数
| 参数 | 类型 | 作用(英文) | 默认值 / 允许的值 |
|---|---|---|---|
start | date | First eligible date, inclusive, in YYYY-MM-DD format. Defaults to January 1 of the current year. | 可选YYYY-MM-DD |
end | date | Last eligible date, inclusive, in YYYY-MM-DD format. Defaults to December 31 of the current year. | 可选YYYY-MM-DD |
filter | string | Limit eligible dates to all days, weekdays, or weekends. | 默认:anyany, weekdays, weekends |
count | integer | Number of results to return. | 默认:11 到 50 |
unique | boolean | When true, the response will not contain the same date twice. | 默认:truetrue 或 false |
sort | boolean | When true, return selected dates in chronological order. | 默认:truetrue 或 false |
你可能还喜欢
使用方法
- 1设定开始和结束日期。
- 2选择哪些日子算数以及数量。
- 3点“生成”,复制日期。
常见问题
包括开始和结束日期吗?
包括,范围两端的日期都可能被选中。
每一天的机会都一样吗?
一样,范围内每个符合条件的日子机会都相同。