View Full Version : Could this be done in JAVA?

07-07-2002, 11:28 AM
I have an event creator written in ASP which saves the current event as a HTML file...

What needs to be done is to check the current events file to see if its older than 3 hours, if its is then it'll show no events or no_events.html, else show the current event etc.


07-08-2002, 06:40 AM
Why would you want to do it in JS when it can be easily accomplished server side in ASP, that you are using:confused: :confused: :confused:

07-08-2002, 12:56 PM
You know when you get to that stage when you just can't get your head around a peice of code and start pulling your hair out to look for alternatives...

Well i've sorted it now, thanks for the reply, after the 60th view!!!!!!! lol

Heres what i came up with:


Dim MyFileObject, MyFile, MyFileTrue, TimeOut, RealTime
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
set MyFile=MyFileObject.GetFile(Server.MapPath("current_event.htm"))

RealTime = hour(now)
TimeOut = hour(MyFile.DateLastModified) + 3 ' Put timeout at 3 ours ahead of the creation date

If RealTime < TimeOut AND day(now) = day(MyFile.DateLastModified)Then
<!--#include file="current_event.htm"-->
<!--#include file="none.htm"-->
end if
Set MyFileObject = nothing
Set MyFile = nothing
set RealTime = nothing
set TimeOut = nothing