Answers for "linux get date yyyymmdd"

5

date linux format yyyymmdd

# 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')
Posted by: Guest on October-29-2020
1

linux get date yyyymmdd

date '+%Y/%m/%d' #Output 2022/03/11
Posted by: Guest on March-11-2022

Code answers related to "linux get date yyyymmdd"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language