shell 获取当前时间

1.获取当前时间

currentyear=$(date +%Y)
currentyearmonth=$(date +%Y-%m)
currentyearmonthday=$(date +%Y-%m-%d)
echo $currentyear
echo $currentyearmonth
echo $currentyearmonthday
原文地址:https://www.cnblogs.com/chong-zuo3322/p/15097588.html