Date command
ARTH — Task 1.4:
Task Description 📄
📌 Explore date command and with options and try to use every option and create a simple document for it.
Date command is used to display the system date and time. date command is also used to set date and time of the system. By default the date command displays the date in the time zone on which unix/linux operating system is configured. You must be the super-user (root) to change the date and time.
Date options with some demos:-
- To print the current date and time just simply type “date” in terminal.
2.This command displays date and time in any format.
3. This lets you display past dates.
4.This command helps to display future dates.
5.We can save the date in file using this command.
Format Specifiers :-
%D: Display date as mm/dd/yy. %d: Display the day of the month (01 to 31).
%a: Displays the abbreviated name for weekdays (Sun to Sat).
%A: Displays full weekdays (Sunday to Saturday).
%h: Displays abbreviated month name (Jan to Dec).
%b: Displays abbreviated month name (Jan to Dec).
%B: Displays full month name(January to December).
%m: Displays the month of year (01 to 12).
%y: Displays last two digits of the year(00 to 99).
%Y: Display four-digit year.
%T: Display the time in 24 hour format as HH:MM:SS.
%H: Display the hour.
%M: Display the minute. %S: Display the seconds.