Answers for "date linux format yyyymmdd"

1

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

Code answers related to "date linux format yyyymmdd"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language