[TIP] Date/time condition in a server script

denisfo

Newcomer
Joined
Apr 19, 2010
Messages
1
Reaction score
2
Points
0
Location
Paris
Imagine you have a long script and some commands of this script may not be submited after a certain time.

you can do that by this command :

example for command which not be ran after 6.45pm

Code:
select 0/(case when current_time>'18:45:00' THEN 0 ELSE 1 END) from options where option_name='FileExit' 
/* the select will return an error (division by zero) if time exceeded */

if (warning, error) goto SUITE
/* No error the time is not exceeded ok to do the command */
/* Put HERE your command */
next:
/* Put HERE the following of the script */
 
Back
Top