[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: the date utility?
- From: Karl Pearson <karlp ourldsfamily com>
- To: Redhat Install <redhat-install-list redhat com>
- Subject: Re: the date utility?
- Date: Sat, 31 Mar 2001 00:12:09 -0700 (MST)
The date utility is a little confusing, but not so much that it can't be
mastered if used enough. Since no one should have to use it that much,
here's how I remember it.
man date
Okay, really. Just type date j134klj134 or some other gibberish and see what
it sends back. I got garbage. Wow, it's changed. But if you look at the man
page, you get the output I expected:
date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
So, to set the date for 12:04 AM, Sat. Mar 31, 2001 the command would be:
date 033100042001.00
which gives the command the whole date, including Month, Day, Hour, Minute,
4-digit year and seconds in .00 format. I usually just run date and see if
the year is already correct so I don't have to use the year or .sseconds.
That command would be:
date 03310004
which would set the time to 4 minutes after midnight on March 31, which was
about 4 minutes ago now.
Since I'm fulltime internet through DSL, I have a cronfile for doing it
which queries a time server and sets the system time for me. Then I write
that time to the CMOS clock so it matches and the time doesn't change at the
next boot. The lines in my cronfile are:
0,30 0-23 * * * /usr/bin/rdate -s clock.psu.edu
5,35 0-23 * * * /sbin/clock -w
This is a little over-done but this system loses time so fast that I want it
to be done at every hour and half hour. You could use a different time
server if you want. Another good one is time.nist.gov.
Happy time syncing.
Karl L. Pearson
Senior Consulting Systems Analyst
Senior Consulting Database Analyst
karlp ourldsfamily com
On Sat, 31 Mar 2001 awesome-dave1 juno com wrote:
> Hello,
> Can someone explain the date utility? I'm trying to get it working, but
> I'm getting confused as to all the different numbers. All I'd like to do
> is set the current date/time.
> Thanks.
> Dave.
>
> ________________________________________________________________
> GET INTERNET ACCESS FROM JUNO!
> Juno offers FREE or PREMIUM Internet access for less!
> Join Juno today! For your FREE software, visit:
> http://dl.www.juno.com/get/tagj.
>
>
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list redhat com
> https://listman.redhat.com/mailman/listinfo/redhat-install-list
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]