How To Set Date, Time And Timezone In FreeBSD?

How To Set Date, Time And Timezone In FreeBSD?

 

This post was last updated on August 1st, 2020 at 10:27 am

FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution. It is used to power modern servers, desktops, and embedded platforms.

In FreeBSD date and time can be displayed using the date command. This article describes how to set date and time using date command in FreeBSD.

How to display the current date and time

To display the current date and time use the following command in your terminal –

date

How to set date and time in FreeBSD

To modify systems date or time you need to be a superuser or root user.

Change the date and time in a single command

If you want to change both date and time then you should use the date command in the given format –

date yymmddHHMM

where,

yy – Year in two-digits

mm- Month of the year (1-12)

dd- Day of the month(1-31)

HH- hours(0-23)

MM-  Minutes (0-59)

For example to set today date July 13 2020, 13:07:00  you should use –

date 2007131307

Set the time only

To change the time without changing the date, you should use the date command in the given format –

date HHMM

For example to set time 13:07:00 we will use –

date 1307

How to change the timezone

For setting the local time zone tzsetup command is used in freebsd. This command reads the database of timezone information, the content of the database is indexed by
/usr/share/zoneinfo/zone.tab

Now to change the time zone execute the following command in your terminal –

tzsetup

This will open the terminal menu to select the time zone. Look in the image below –

First, choose your timezone area and then select your country or region and press ok. This will open another confirmation window if abbreviation looks reasonable then press enter. Your time zone is changed successfully.

Now run the date command –

date

As you can see that the time zone is changed from UTC to IST(Indian Standard Time).

Ok, that’s all for now. If you want to say something on this topic you can write to us in the comments below.

Previous [lubuntu] Where should I start for building the developers version for x86?
Next Backup for those times you get the "Emergency Screen"
 

About author

You might also like

How To 0 Comments

How To Add Bash Auto Completion In FreeBSD?

This post was last updated on August 1st, 2020 at 09:06 amBash is a modern and one of the most widely used shells in Unix like operating systems. It is

How To 0 Comments

How to PDF Documents in Linux

This post was last updated on June 3rd, 2020 at 04:23 pmContents1 Using ps2pdf in Linux2 Using Windows and Linux to Generate PDF Documents3 Using Linux Only to Generate PDF

Linux Topics 0 Comments

How To Set Read/Write Permissions On A NTFS Partition In Linux?

This post was last updated on September 1st, 2020 at 03:36 pmA hard disk can have various partitions on it. Partition refers to the logical divisions of a physical disk

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply