You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can save the current time by using -v and specifying the variable name. To save the current time in a variable cdate and print it, we can do the following:
$ printf -v cdate '%(%F)T' -1
$ echo $cdate
date +"%m-%d-%y"
To convert the year into a four-digit, change y to Y.
$ date +"%m-%d-%Y"
To add N days in the date, we use the following command: