Getting system time from CSM with TCL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 05:12 PM
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
- Labels:
-
Application Networking
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2007 05:54 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2007 10:29 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2007 01:16 AM
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.
