how to read systems current date and time

Answer Posted / kirtiranjan sahoo

we can use DATE command to know the system date and time.
and want to any modify, then
date +%Y-%m-%d
Y: Year
m: No of month
d: date number
If you want to know the yesterday date, simply you can write the below command
date -d "yesterday"
or
date -d "-1day"

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I read a .sh file?

545


What's the difference between scripting and coding?

622


What is a program shell?

591


What is meant by $1 in shell script?

562


How do you find out What is your shell?

598






Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

1865


How can I send a mail with a compressed file as an attachment?

563


How to check if the previous command was run successfully?

601


Is powershell a language?

576


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

584


What is difference between bash and shell?

566


Why is it called a shell?

519


What does path stand for?

649


What is the conditional statement in shell scripting?

667


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

813