FreeBSD: Change date/time from command line
How can i change/update date/time/timezone in FreeBSD from command line?
Changing date/time in FreeBSD operating system is not much different from what we use in normal linux operating systems which i had explained in this howto: Change date/time in linux from command prompt.
To display the date:
Simply type the date command to display the current date:
Output:
To set/change date:
To set the date, you need to simply use the date command followed by the year, month, day, hour, minute, and second … all numeric and no spaces.
To set the date with date command, you need to follow this format:
Where
yy : Year (01-12)
mm : Month (01-12)
dd : Day (01-31)
hh : Hour (00-23)
MM : Minute (01-59)
ss : Seconds (00-59)
So, to set the date to 15-Feb-2009, 12:14 PM, we need to do like this:
Output:
Set time without modifying date:
To set the time to 03:37 PM without modifying date, use this command:
Change Timezone:
To setup or change the timezone in freebsd, please refer to this post Change Timezone in Linux/Unix
If you enjoyed this post, make sure you subscribe to my RSS feed!!!!