Answers for "bash date format yyyymmdd without hypen"

2

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 "bash date format yyyymmdd without hypen"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language