Operating System - HP-UX
1833788 Members
2589 Online
110063 Solutions
New Discussion

How do I change the system date on an HP-UX operating system?

 
Chris Wroblewski
New Member

How do I change the system date on an HP-UX operating system?

How do I change the system date on an HP-UX operating system?
10 REPLIES 10
Ken Hubnik_2
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?

date mmddhhmm
date 12060914
Stefan Farrelly
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?


date

in format mmddhhmm[cc]yy

you should shutdown to single user mode first (init s) then change date, then reboot, to ensure all system processes pick up the new date correctly.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Patrick Wallek
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?

Try the 'date' command.

# man date

for more information.

# date 120609152002

Will change the date on the system to 09:15 Dec. 6, 2002.
V. Nyga
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?

Hi,

date mmddhhmm(yy) that's it.

You can check the command with man date.

It is month-day-hour-minute(year not needed)

Regards
Volkmar
*** Say 'Thanks' with Kudos ***
Jean-Louis Phelix
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?

hi,

You already got solutions, but changing system date can disturb some applications. If you want to do it anyway without rebooting the system and if your change is not too big, you can use '-a' option of date to slowly adjust system date. See man date.

To slowly go 15 mn earlier use :

date -a -900 (15 * 60)

To slowly go 10 mn later use :

date -a 600 (10 * 60)

Regards.

It works for me (© Bill McNAMARA ...)
Bob Milton
New Member

Re: How do I change the system date on an HP-UX operating system?

I cronjob /usr/sbin/ntpdate IP of router time synced to GMT. Keeps some of my older servers on time.
Nick Tarmey_3
Occasional Advisor

Re: How do I change the system date on an HP-UX operating system?

Hi, you could also use set_parms like so:

set_parms date

g'luck!
Nick
lanke_1
Advisor

Re: How do I change the system date on an HP-UX operating system?

Hi,

As it is already said above

try man on date and adjust
the date accordingly.

The date format is: mmddhhmmyy

mm - month 0-12
dd - day 0-31
hh - hour 0-12
mm - minute 0-60
yy - year 0-12

Example:
Set date to Dec 1st 4.00PM

#date 1201160002
date: do you really want to run time backwards?[yes/no]y
Only "yes" will make it take!


Thanks,
Lanke


lanke_1
Advisor

Re: How do I change the system date on an HP-UX operating system?

There is a typo

yy - year 0-9999

Michael Tully
Honored Contributor

Re: How do I change the system date on an HP-UX operating system?

If your running any sort of database, do not change the date whilst these instances are up. You can cause all sort of problems. If you must change the date, at the very minimum, shutdown all your databases. The best way would to be in single user mode as suggested or do it during your next reboot. For the future you might want to look into implementing NTP. There are stacks of posts about this.
Anyone for a Mutiny ?