Hello,
I have a problem implementing datediff function in script with the
input from txt file, where the data is in the followingformat:
10:00
08:01
I need to subtruct the timelast-timeprev, where the timelast is the
first line in the file and
timeprev is the second line in the file. Here is the script:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\timerun.txt", 1)
timeLast = objFile.Read(6)
'wscript.echo timeLast
timePrev = objFile.Read(10)
' wscript.echo timePrev
timeDiff= Round((DateDiff("n", timeprev, timelast)/60),2)
'timeDiff= (DateDiff("n", timeprev, timelast)/60)
timeDiff2= DateDiff("n", timeprev, timelast)
'wscript.echo timeDiff
If timeDiff2 < 60 then
mytime =timediff2
InfoMB=MsgBox ("result:"&Space(1) &mytime &Space(1)
&"minutid",vbInformation + vbOKCancel, "test")
wscript.echo "result:" &Space(1) &mytime &Space(1) &"min"
Do you have any suggestions?
Thanks.
Vitali.