I thought I had the solution but there are still problems.
The DateTimeDiff UDF should solve the problem. Probably I'm doing something wrong...
The UDF returns strange dates:
Code:
$dd = datetimediff($date+$time,$nextday+'00:00') gives 0000/02/16 00:00
$dd = datetimediff($date+$time,$nextday+'24:00') gives 0000/03/10 00:00
Code:
$computers = 'comp1','comp2','comp3','comp4','comp5','comp6','comp7','comp8','comp9','comp10'; etc
For Each $comp In $computers
; filter
;------------------------------
;$os = osid($comp)
;
;If $os[1]='Win2K' AND $os[2]<>'Workstation' AND InStr($comp,"comp")<>0
; Date Format
;------------
$d = Split($date,'/')[1] + '/' + Split($date,'/')[2] + '/' + Split($date,'/')[0]
? 'Time before Task: '$time
? 'Date YYYY/MM/DD before Task: '$date
? 'Date MM/DD/YYYY before Task: '$d
? $comp
; Schedule Task
;------------------------------
$rc=scheduletask($name, $comp, $d, $time, $type, $cmd)
? 'Error '+@ERROR+' - '+@SERROR
; Date /Time
;------------------------------
$Nextday = DateMath($date, 1) ;Date YYYY/MM/DD
$dd = datetimediff($date+$time,$nextday+'00:00')
? $nextday
? $dd
;$td=TIMEDIFF($time,'24:00')
$time=serialtime(serialtime($time)+ serialtime($timediff))
? 'New starttime: '$time
? 'Date YYYY/MM/DD After changing starttime: '$date
Next
Quote:
Time before Task: 23:29
Date YYYY/MM/DD before Task: 2003/12/30
Date MM/DD/YYYY before Task: 12/30/2003
comp1
Error 0 - The operation completed successfully.
2003/12/31
0000/02/16 00:00
New starttime: 23:59
Date YYYY/MM/DD After changing starttime: 2003/12/30
Time before Task: 23:59
Date YYYY/MM/DD before Task: 2003/12/30
Date MM/DD/YYYY before Task: 12/30/2003
comp2
Error 0 - The operation completed successfully.
2003/12/31
0000/02/16 00:00
UDF Serialtime 0
New starttime: -1
Date YYYY/MM/DD After changing starttime: 2003/12/30
Time before Task: -1
Date YYYY/MM/DD before Task: 2003/12/30
Date MM/DD/YYYY before Task: 12/30/2003
comp3
Error 1 - Incorrect function.
De beste wensen en een gelukkig nieuw jaar
Best wishes and a happy new year