Display Date And Time In Linux

by Vivek Gite · 0 comments

How do I display date and time in Linux using command line and GUI options?

To display date and time under Linux operating system using command prompt use the date command. It can also display the current time / datein the given FORMAT, or set the system date and time as root user.

Syntax

Open a terminal and type the following command:

date

Sample outputs:

Sat Nov  7 22:44:59 IST 2009

You can format the date as follows in dd-mm-yy format:

date +"%d-%m-%y"

Sample outputs:

07-11-09

To print the date of the day before yesterday:

date --date='2 days ago'

To print the day of year of Christmas in the current year:

date --date='25 Dec' +%j

To print the current full month name and the day of the month:

date '+%B %d'

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-admi

OR

time-admi
Fig.01: Linux Date and Time  Administration Tool

Fig.01: Linux Date and Time Administration Tool

You may be prompted for the administrator password (root password), this is necessary because the changes done with this tool will affect the whole system.

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All