data计算两年后时间戳(s)

当前时间戳

1
date +%s

两年后的时间戳

1
date -d "+2 years" +%s

如果你的系统是 macOS(BSD date),语法稍微不同,要用 -v 参数:

1
date -v+2y +%s