Changing date, time and timezone on FreeBSD

This guide is for those who use FreeBSD and loves the shell

To check the date and time
date

This is what the output may look like.

The data above shows Tuesday January 27 04:52:15 PHT 2009. To change it you have to gain root privileges and type something like this (format)
date yyMMddhhmm

For example, you want to change the date/time to Tuesday January 27 12:32:00 PHT 2009, you have to type
date 0901271253

To check if the new time was set, type
date
and you should see the new settings.

To check your timezone,
less /etc/localtime
If it does not point to anything then that is the default timezone you have entered in the installation of the operating system.e

Suppose you want to change your timezone do the following, (we will use Asia/Manila). Create a symbolic link that will point /etc/localtime to one of the values under the /usr/share/zoneinfo tree
ln -s /usr/share/zoneinfo/Asia/Manila /etc/localtime

Check the /usr/share/zoneinfo tree for more timezones available
ls /usr/share/zoneinfo

To verify that your timezone was changed,

ls -l /etc/localtime

You will now see that /etc/localtime is now a symbolic link to the file /usr/share/zoneinfo/Asia/Manila

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s