Setting date and time

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Setting date and time

Postby dioon » 23 Sep 2010, 08:53

FreeBSD 8.1-RELEASE 64bit

Code: Select all
# date 100923093320
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]

Tried to set today's date and time,but received this error message.
Date and time I wanted was:
Thursday 23 September 2010. 09.33.20s this being YYMMDDHHMMSS

Code: Select all
Sun Oct 10 09:49:57 BST 2010

This is what I get with the Date command.
dioon
Junior Member
 
Posts: 4
Joined: 19 Jun 2009, 20:12

Postby SirDice » 23 Sep 2010, 09:18

Try it without the seconds.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby dioon » 23 Sep 2010, 10:16

Thank you SirDice all fine now.
dioon
Junior Member
 
Posts: 4
Joined: 19 Jun 2009, 20:12

Postby SirDice » 23 Sep 2010, 12:01

If you have Internet access on that machine and your ISP has an NTP server you can also use [man=8]ntpdate[/man] to set the time correctly. Or install [port]net/openntpd[/port] to keep it constantly in sync. The [man=8]ntpd[/man] from the base will also work but it's a bit limited.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16149
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Anyone with sisters or a wife knows to mind the period

Postby fronclynne » 23 Sep 2010, 16:51

dioon wrote:
Code: Select all
# date 100923093320
date: illegal time format
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
            [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]


What you wanted was [cmd=#]date 1009230933.20[/cmd].
[color="DimGray"]Quid habemus reliquum?
Nutrimentum anatum![/color]
[color="Teal"]Внимание: лифт вниз не поднимает[/color]
User avatar
fronclynne
Senior Member
 
Posts: 1297
Joined: 09 Feb 2009, 04:47
Location: Lunch Time


Return to General

Who is online

Users browsing this forum: Google [Bot] and 1 guest