Skip to main content

How to set time and date using unix command

date
Date displays the date and time of the system, used by root it can also be used to change the date and time of the system.

If you just enter:

date

You will get the date of the system, like this;

Fri May 18 19:36:53 MYT 2009

You can set the date by using root user:

Usage:

date nnddhhmm[[cc]yy][.ss]

Note:

  • nn = month of the year (01 to 12)
  • dd = day of the month (01 to 31)
  • hh = hour of the day (00 to 23)
  • mm = minute of the hour (00 to 59>
  • cc = The first to digits of the year
  • yy = The last two digits of the year
  • .ss = The seconds
Example:

date --set 06:00 ;sets the time to 6:00AM

OR

hwclock

hwclock is a tool for accessing the Hardware Clock. You can display the current time, set the Hardware Clock to a specified time, set the Hardware Clock to the System Time, and set the System Time from the Hardware Clock.

SYNOPSIS

hwclock -r or hwclock --show
hwclock -w or hwclock --systohc
hwclock -s or hwclock --hctosys
hwclock -a or hwclock --adjust
hwclock -v or hwclock --version
hwclock --set --date=newdate
hwclock --getepoch
hwclock --setepoch --epoch=year

Example of change date and time.

hwclock --set --date='08/18/07 21:08:40' --localtime

Comments

Popular posts from this blog

What is a kernel panic? (Mac OS X)

I believed most of the Mac OS user see this screen before. Most of your will feel panic when u see this screen. After this screen appear, your just need to press power button off and on your Mac. Your system will back to normal. But i think your do not know what was happening. It is because the kernel of an operating system receives an instruction in an unexpected format, or that it fails to handle properly. A kernel panic may also follow when the operating system is not able to recover from a different type of error. A kernel panic can be caused by damaged or incompatible software or, more rarely, damaged or incompatible hardware.

How to Create a Mailing List in Outlook Express

If you want send the same email to several people, you might feel frustrated cause you need to enter a lot of email address on the same time even the people are in the same group. To solve this problem, you can try set up a mailing list. With this list, you can email several people at once without choosing each email address separately. To set up a mailing list using Outlook Express: . Select Tools | Address Book... from the menu in Outlook Express. Select File | New Group... from the address book's menu. Type the name of your mailing list in the Group Name: field. Eg: ITDept Click the "Select Members" button on the right. Click a name from your "Contacts" list. Click the "Select" button. Click another name from the list and click "Select" again. Continue choosing names until you complete your list. Click the "OK" button at the bottom of the box when your selection is complete. Click "OK" if you are finished.

How to setup Apple Wireless Keyboard

By default, Apple Wireless keyboard is not functioning at all. In order to make the Wireless Keyboard workable, follow the following steps to setup it: Install the Apple Wireless Keyboard and Mouse software that came with the keyboard. Insert the CD, double-click the installer, and follow the onscreen instructions. Turn the keyboard over, install the batteries as illustrated and replace the battery cover. Open the Bluetooth Setup Assistant. Click Continue . At the Select Device Type panel, select Keyboard. Do not click Continue yet. Using the power switch on the bottom of the keyboard, turn the keyboard on. The light above the power switch should begin to flash. Click Continue . The keyboard's name should appear in the device list of the Search pane. Select the keyboard in the Setup Assistant listing, then click Continue . The assistant will try to pair with the keyboard. When the Setup Assistant prompts you to do so, type the passkey shown in the Setup Assistant on the Apple ...