To display date and time under Linux operating system using command prompt use the date command. It can also display the current time / date in the given FORMAT. We can set the system date and time as root user too.
Syntax
Open a terminal and type the following command:
date
Sat Nov 7 22:44:59 IST 2009
You can format the date as follows in dd-mm-yy format:
date +"%d-%m-%y"
07-11-09
To print the date of the day before yesterday, run:
date --date='2 days ago'
Want to see the day of year of Christmas in the current year? Try:
date --date='25 Dec' +%j
Display the current full month name and the day of the month:
date '+%B %d'
Display date and time un Linux using the timedatectl
Most modern Linux distro with systemd use the timedatectl command. It is used to query and change the system clock and its settings, and enable or disable time synchronization services. All you have to do is type the following command:
$ timedatectl
GUI Tool: Time Administration
The Time Administration Tool allows you to set the time, date and timezone of your system, as well as setting any time server to synchronize your local time server. Type the following command to start time admin tool:
sudo time-admin
## OR ##
time-admin

Fig.01: Linux Date and Time Administration Tool
How to change date and time settings with Gnome based Linux desktop
First, you need to Settings in Activities and then click Details in the sidebar. Make sure you click Date & Time in the sidebar to open the panel:
Conclusion
In this quick tutorial, you learned about the date command that you can use to see or change the date/time under Linux operating systems. We further explained how to use the GUI tools too. The date command has many more options. See man page by typing the following man command:
$ man date
- RSS feed or Weekly email newsletter
- Share to Twitter • Facebook • 5 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
sir i want to set date format to dd/mm/yyyy but not able to do it
that when i execute date command i get output in dd/mm/yyyy format if any help
please reply
thanks
ramkumar sharma
Please try this
date +%d/%m/%Y
hi sir i want to ask favor . can u answer this my project.
converting php to mysql
and inserting date and time in/out
thank u sir..
hope u get it
Is there any way this can be done in the motd and show the current time of the login?
How can someone from termial get current time from any zipcode around the world?