Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX System Date

Status
Not open for further replies.

KOG

MIS
Jan 31, 2002
303
0
0
GB
Hi Folks

Lately I seem to be having probs with the system date, for some reason it changes time (I am aware the hour went forward two weeks ago) and it didn't update the hour so I had to manually update it.

This morning I checked the time at 8:56 but on the system clock it came up as 02:something? ?? why is the hour set at 02?

# date
Wed Apr 7 08:57:20 BST 2004

What does BST mean?

I am going on my holiday tomorrow so would like it sorted as I have lots of jobs scheduled to run and they depend on the system date.

Can you please explain to me what is happening here?

Thanking you in advance.

Rgds

K
 
K.

BST is British Summer Time. I assume you are in the UK? If so, and if it helps, the following is the TZ setting on our AIX boxes:

GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00

This setting moves the clock forward an hour at the end of March and backward in October.

Type echo $TZ to see what your TZ is set to currently.

You can set the TZ (which is stored in the /etc/environment file) using:

chtz GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00

You can also reset TZ interactively using:

export TZ=GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00

Hope this helps, post back if not.
 
Hi Ken

Yes I am in UK and the output for $TZ is

$ $TZ
ksh: GMT0BST10:59,M3.5.0,M10.5.0: not found.

So I assume I have to run

# export TZ=GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00

will it disrupt oracle database that is currently working on the box?

I am anxious to get it sorted and this is the first time I have ever seen such result.
 
I believe BST is British Standard Time.

Which could makes sense based upon location. Where are you located at?

It sounds like your TZ variable is not set at all. In which case my suggestion would be this.

smitty system
Change / Show Date and Time
Change Time Zone Using System Defined Values

Arrow key up or down to yes or no. *from your post since you had to change the time, I am STRONGLY thinking you want to choose, YES*

A list will appear, choose your time zone. For instance I am in the Eastern USA, so I generally choose EST5EDT.

Hit enter.
Ignore the next screen which is labeled "Change Time Zone" (it is for if you want the time change to occur at another time besides the normal dates)
Hit enter.

This will make your change, and take affect upon reboot.

Reboot and check your time. Use the date command to now adjust your clock to the current time in your selected timezone.

-Kanth
 
Hi

I checked /etc/environment and some of its contents is

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin
TZ=GMT0BST10:59,M3.5.0,M10.5.0
LANG=en_US
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
LC__FASTMSG=true


To be honest I dont understand what is happening here, is the format for TZ incorrect above?

Should I remove it and insert

GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00

Does it require rebooting as it means I will have to wait till all users log off later this evening?

Thanking you all for your quick responses.

Regards

K
 
It seems your $TZ is actually set to

GMT0BST10:59,M3.5.0,M10.5.0

for whatever reason (use echo $TZ to get the actual setting, not just $TZ).

I think it would be sensible for you to use chtz, then export TZ as described above and using the settings I included in my earlier post. This shouldn't require a reboot but it might be an idea to stop and restart cron by killing the daemon (it should respawn anyway). I don't think Oracle should be affected by this change, it certainly isn't in our case. HTH.
 
Hi Ken

Again many thanks for your quick responses, the following is the list of commands I ran and hopefully it means all is sorted?

# echo $TZ
GMT0BST10:59,M3.5.0,M10.5.0
# chtz GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00
# export TZ=GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00
# echo $TZ
GMT0BST,M3.5.0/02:00:00,M10.5.0/03:00:00
#

Does that look ok now? But when I ran the date command it does not reflect the true date?

# date
Wed Apr 7 21:23:51 BST 2004

It should be

Wed Apr 7 09:23:51 BST 2004 (not 21)

What should I do - manually adjust the time using smitty?

smitty system
Change / Show Date and Time

What abt "Change Time Zone Using System Defined Values" in smitty?

Thanks again

Regards

K

Many thanks


 
As you say, the date is some 12 hours ahead, so it would be as well to change it (using smit if you like, but you can also do this manually using date). This anomaly is probably the result of the 10:59 entry in your original TZ setting (ie 10:59 hours:mins ahead of BST, 11:59 if you include the hour added at the chage in March).

One point - does your Oracle application include any form of batch-scheduling facility (ie application not cron dependant)? If so, you might have to watch for jobs repeating themselves if they are timed to work within the last 12 hours. If not, you should be OK, but again, check cron. I really cannot understand why the 10:59 was included in the first place, but that's a separate issue!
 

We dont have oracle batch job running only scripts to do backups, updating the database etc but they ran before midnight so all was ok until this morning when I had few script jobs to run and it failed that is how I discovered the sys date was set for 2am not 8:56am!!

Now the sys date is
# date
Wed 7 Apr 09:52:41 2004

Will it stay in that format and not give me any more grief ! :)

Thanks again for your help.

Regards

K
 

Hi again

What do u know abt Network Time Protocol (NTP)? Is there a script I can run which monitors the system clock?

I am aware microsoft servers do have it but what abt ibm servers?

Cheers

K
 
I would hope so, yes, as long as echo $TZ looks OK, it is included in /etc/environment as above and the date reports the correct date/time. I assume this remains the same after you log out and log back in?

If so, I think you should be getting ready for your hols - have a good one!
 
Sorry - cross posted there. We don't use NTP (perhaps we should!), but Thread52-691811 might give you some clues. There are also other threads if you do a keyword search in this forum for NTP. Good luck.
 
It seems fine when I logged off and back on .. so fingers crossed thanks again.

Have a good easter break too cheers ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top