1833589 Members
3702 Online
110061 Solutions
New Discussion

Adjusting the Time

 
Kirk Solano
Occasional Advisor

Adjusting the Time

Everytime I have anything printed out...It displays a time somewhere on top of the document. Right now the time on it is wrong. I need to change the time. How would I go about doing that? thanks in advance.
"You're never too young. It's never too early."
5 REPLIES 5
Eileen Millen
Trusted Contributor

Re: Adjusting the Time

You can display the date and time with
date
you can also change it with date
have a look at the man page for date
Vincenzo Restuccia
Honored Contributor

Re: Adjusting the Time

date [-u] [mmddhhmm[[cc]yy]]


Set the HP-UX system clock to the date and time specified. You require the superuser privilege.

If you include the -u option, the specified date and time is assumed to be in Coordinated Universal Time (UTC).

The numeric argument is interpreted left to right in two-digit pairs as follows: mm Month number [01-12].
dd Day number in the month [01-31].
hh Hour number (24-hour system) [00-23].
mm Minute number [00-59].
cc Century minus one [19-20].
yy Last two digits of the year number [70-99, 00-37 (1970-1999, 2000-2037)]. If omitted, the current year is used.

Edward Sedgemore
Trusted Contributor

Re: Adjusting the Time


You can indeed change the date as superuser or root using the date command but you should not do it with an up and running system, for all sorts of logs and processes may get confused.

Recommended is shutting down the system to single user mode, changing the date/time, and rebooting.
Bill Hassell
Honored Contributor

Re: Adjusting the Time

Actually, the date command is very dangerous to use on a database system. Moving it forward or backward can corrupt database linkages where the date/time is used as an index or link. For these systems, date should have a wrapper that prevents changing the date except on bootup.

These systems should be setup with NTP and with the latest version of ntpdate, you can slowly aadjust the time to match the reference.


Bill Hassell, sysadmin
jok
Occasional Contributor

Re: Adjusting the Time

In a single usermode;
# date 11091335
-->This sets the date to November 9, 1:35PM
Repeatation make once perfect, excelence then is not a act but a hobbit