OpenBSD Set Date and Time
Q. How do I set new date and time under OpenBSD UNIX server?
A. You can set date and time using date command. OpenBSD date command uses following syntax:
date yyyymmddhhss
where,
=> yyyy - Year
=> mm - Month
=> dd - Day
=> HHSS - Hour Second in 24 clock format
WARNING! These examples requires root level privileges (you must login as root).Set the date to April 23, 1979, 4:27 PM, enter:
# date 197904231627
Set the time to 2:32 PM, without modifying the date, enter
# date 1432
To display current date and time, enter date command without option:
$ date
Output:
Sat Apr 3 11:06:51 IST 2008
Display the date using the specified format string:
$ date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S"
Output:
DATE: 2008-05-03 TIME: 11:07:55
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Linux or FreeBSD command to display system time and date
- Linux set date and time from command prompt
- OpenBSD Install Ports Collection
- FreeBSD: Set date time and timezone
- OpenBSD Change Hostname
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: clock format, date command, dd, hhss, new date, openbsd set date, openbsd set time, privileges, root level, UNIX, unix server, yyyy ~ Last updated on: May 3, 2008



Recent Comments
Today ~ 3 Comments
Today ~ 19 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments