日期加减计算器 | 快速计算日期差异
使用日期计算器,您可快速计算任意日期加减指定天数、周数、月数或年数,便于活动规划或回顾重要时刻。
结果
如何使用日期计算器
1. 选择您的起始日期和时间
2. 选择加或减时间段
3. 输入年、月、周、天、小时、分钟或秒的值
4. 点击计算查看结果
主要特点
- 精确计算未来和过去的日期
- 支持多种时间单位
- 即时计算与实时验证
- 一键复制结果
常见用例
- 项目截止日期规划
- 合同期限计算
- 事件规划和安排
- 年龄计算
从你的AI智能体调用此工具
免费的JSON API和Model Context Protocol (MCP) 服务器。无需注册、无需API密钥、CORS开放。专为Claude、ChatGPT、Cursor、脚本和前端应用设计。
curl -X POST https://mate.tools/api/v1/date-math.php \
-H "Content-Type: application/json" \
-d '{"start":"2026-05-10","add":"+90 days"}' import urllib.request, json
req = urllib.request.Request(
"https://mate.tools/api/v1/date-math.php",
data=json.dumps({"start":"2026-05-10","add":"+90 days"}).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)) const r = await fetch("https://mate.tools/api/v1/date-math.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"start":"2026-05-10","add":"+90 days"}),
});
console.log(await r.json()); 添加到 claude_desktop_config.json(Claude Desktop)、~/.cursor/mcp.json(Cursor)或任何其他MCP兼容客户端:
{
"mcpServers": {
"mate-tools": {
"command": "npx",
"args": ["-y", "@mate-tools/mcp-server"]
}
}
} 常见问题
计算器根据您的系统时区设置自动调整夏令时。
可以,您可以加或减任意年数,计算器将正确处理闰年。
计算器会自动调整到最近的有效日期。例如,将一个月加到1月31日将变为2月28日(或闰年的2月29日)。