SOFTWARE ENGINEERING

EMERGING TRENDS IN SOFTWARE ENGINEERING

DEVOPS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
How to view today date in Linux
A
date
B
date +%D
C
date %d
D
date +%d
Explanation: 

Detailed explanation-1: -To display current date and time under Linux operating system using command prompt use the date command or timedatectl command. These commands can also display the current time / date in the given FORMAT. We can set the system date and time as root user too.

Detailed explanation-2: -The date command can also be used to display the Epoch time. The Epoch time (Unix time or Unix timestamp or POSIX time) is the time (in seconds) that have been elapsed since January 1, 1970. To display the time from the epoch to the current date, execute the command with the ‘%s’ option as follows: date +%s.

Detailed explanation-3: -To format date in YYYY-MM-DD format, use the command date +%F or printf “%(%F)T” $EPOCHSECONDS . The %F option is an alias for %Y-%m-%d . This format is the ISO 8601 format.

Detailed explanation-4: -Yesterday date YES DAT=$(date–date=’ 1 days ago’ ‘+%Y%d%m’) Day before yesterdays date DAY YES DAT=$(date–date=’ 2 days ago’ ‘+%Y%d%m’) 26-Feb-2014

There is 1 question to complete.