COMPUTER SCIENCE AND ENGINEERING
UNIX
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
how to print the date of the system
|
date
|
|
date +%d-%m-%y
|
|
date +’%D-%M-%Y’
|
|
date +’%d-%m-%Y’
|
Explanation:
Detailed explanation-1: -To format date in MM-DD-YYYY format, use the command date +%m-%d-%Y . Please observe the upper and lower case letters : %m for month, %d for day and %Y for year.
Detailed explanation-2: -Linux date Command Format Options These are the most common formatting characters for the date command: %D – Display date as mm/dd/yy. %Y – Year (e.g., 2020) %m – Month (01-12)
Detailed explanation-3: -To use the date in MM-DD-YYYY format, we can use the command date +%m-%d-%Y. It is very important to note that format option codes are case sensitive. In this example, we have used %m for a month, %d for a day and %Y for a year.
There is 1 question to complete.