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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time check in the script

Status
Not open for further replies.

StoneColdphoneman

Technical User
Jan 13, 2003
360
US
I'm trying to setup script to capture file and then push it to my PC
I got most of the script to work, the only issue that I’m having is TIME.

I start my script at 02:00:00 it runs until 23:59:50 --- this works fine
When I start my script at 02:00:00 and I’m trying to run it till 01:00:00
Script runs and when it gets to time check it shuts down.

Here's the script:

PROC TIMECHECK

waituntil "01:00:00"

capture off

disconnect

pwexit

ENDPROC
 
I think this fails because the end time is before the start time, and the time is on a 24 hour clock. It should work if you include the date in the waituntil command. You can use the $ltime value to get the current time, then add some seconds to that, and then use ltimeints to get the date for the next day. Or use one of the date/time commands to find/set the date with the waituntil command to fit your needs
 
kxboy is correct on this, from the help file:

Pauses processing until the specified date and/or time.

string [string] A time string and optional date string, specifying when script processing should continue. The date and time strings must conform to the Short date style and Time style formats specified in the Windows Control Panel's Regional Settings section.

If the date string is not specified, the default is the current date.

You can add 86400 to the value of $LTIME to push it to a value the next day, then use that in the waituntil command. Something like this should work:

PROC TIMECHECK
string DateString, TimeString ; Time and date strings.

ltimestrs $LTIME+84600 DateString TimeString

waituntil "01:00:00" DateString

capture off

disconnect

pwexit

ENDPROC

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top