//输出电脑系统的年月日星期以及时间 var nowDate = new Date(); var year = nowDate.getFullYear(); var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate(): nowDate.getDate(); var hours = nowDate.getHours() <10 ? "0" + nowDate.getHours(): nowDate.
shell脚本汇总 1 以年月日命名备份文件 #!/bin/bash # create a back package for mysql of ball and web of ballcloud # # backup mysql for ball and web for ballcloud cd /www/web/backup_ballcloud/ year=`date +%Y ` month=`date +%m ` day=`date +%d ` now=$year-$month-$day #