PBX Info :: Your Free PBX, PABX and Telephone Information Resource - View Single Post - Sync all PBX's to time server?
View Single Post
Old 07-17-2003, 08:26 PM   #7 (permalink)
TelcoHo
Junior Member

Activity Longevity
0/20 19/20
Today Posts
0/0 sssssss19
Rep Power: 6TelcoHo is on a distinguished road
Lost my Level 2 passowrd

This is the script that I use. I include it as part of my morning routines, which run every morning at 5 using the scheduler app that comes with pcomm.

PHP Code:
proc ld2_stad
    string sysTime
,szM,szD,szY

    substr szM $DATE 0 2
    substr szD $DATE 3 2
    substr szY $DATE 6 2
    substr sysTime $TIME 0 8
    strreplace sysTime 
":" " "
    
strcat szD " "
    
strcat szD szM
    strcat szD 
" "
    
strcat szD szY
    strcat szD 
" "
    
strcat szD sysTime
    transmit 
"STAD"
    
transmit szD
    transmit 
"^M"
endproc 
It should be noted that I've changed my regional settings to set my time format to 24 hr time and my date format to short date. I just did that because aspect is already an interpreted language running through pcomm and I didn't want to waste any more clock cycles than was absolutely necessary between the time when I grabbed the system time and the time when I set the time. I use a very modular programming style, especially with aspect, so this script assumes that you're already in ld 2. I suppose you can also use individual transmits instead of all of the string cats. Dunno if it'd be faster that way. In case anyone's wondering I'm using NetTime 2.0 to synch my pc clock with a local ntp server which synchs off of a local atomic clock.

cheers,
will
TelcoHo is offline   sendpm.gif Reply With Quote