cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
513
Views
0
Helpful
3
Replies

Getting system time from CSM with TCL

lpassmore
Level 1
Level 1

A further saga to my email script that I am writing. I am trying to read the time from the system and include this into an email that is sent when a server goes off line.

Have found the following code seems to do the right thing:

set SysTime [ clock format [ clock scan "8 hours" -base [clock seconds] ] -format "%x %X" ]

Certainly this returns the time and date, but it returns a time that is approximate 4 minutes earlier than the system time.

#show clock

09:02:08.195 WST Thu Apr 19 2007

SysTime value: APR 19 2007 08:58:25

Has anybody managed to get the time successfully and is there a better way?

Thanks

LP

3 Replies 3

Jon Marshall
Hall of Fame
Hall of Fame

Hi

Been a while since i did any TCL :-).

I tried your line on my 6500 and it came out with a completely different time, about 8 hours ahead.

I came up with this which seems to work

set SysTime [ clock format [ clock seconds ] ]

although this might not be what you want

HTH to some extent

Jon

Thanks for the reply Jon

The -base 8 hours is to adjust for the time zone otherwise it is about 8 hours out. The problem is it should be exactly 8 hours not not "about" 8 hours. Be interesting to see if yours is about or exactly 8 hours out

Thanks

LP

I believe this is normal.

The csm gets the time from the supervisor but synch is approximative. That is the synch interval is large.

Gilles.