📜  日期 linux 格式 yyyymmdd - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:00.736000             🧑  作者: Mango

代码示例1
# put current date as yyyy-mm-dd in $date
date=$(date '+%Y-%m-%d')

# put current date as yyyy-mm-dd HH:MM:SS in $date
date=$(date '+%Y-%m-%d %H:%M:%S')

# print current date directly
echo $(date '+%Y-%m-%d')