Wednesday, March 19, 2014

HowTo: Set the Date and Time in Linux:

1)       Solaris:

The fastest way to set the date and time in Solaris is by using the date command while being the super user (root user).

date mmddhhmmyy

The date command takes the syntax mmddhhmmyy, or "month day hour minute year".

date 012112052009
Wed Jan 21 12:05:00 IST 2009
Category: Sun

And the fastest way to set it to the right time would be to use ntpdate(1M) if one has an ntp server.

2)      RedHat:
Run the following command as super user

date --set="Mar 18 15:14:00 2014"