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

Verify PC system date

Status
Not open for further replies.

DutchDFW

Technical User
Jun 26, 2005
3
US
My application requires that the PC system date is identical to the NIST date.
Website provides the NIST date as a simple character string, however, my program crashes on a Permission Denied error when I try to read it and compare it with the PC date.
Does anyone know of a way to read the string provided by NIST.
Over 300 students are waiting for a solution.
Thanks and regards
DutchDFW
 
Why not pro-actively use net time to synchronize it rather than checking whatever.
 
I can as well use the demo script I post to another thread to get you going.
[tt]
set oxmlhttp=createobject("microsoft.xmlhttp")
'this is to control
dt=now
with oxmlhttp
.open "get"," .send
end with
dt2=oxmlhttp.responsetext
set oxmlhttp=nothing

wscript.echo dt & vbcrlf & dt2
[/tt]
The format difference is just a technical detail. You see a material time lag in getting the info. By that is only second in scale unless your application is for rocket science.
 
Thank you very much, tsuji, for your replies and time spent on the problem.

I tested your suggestion and I encounter the same problem as I had with my solution (which incidentally is very similar to yours), namely that there is no trouble running the code from the c-drive, but it crashes with a Permission Denied error when run from a server. My previous solution can be found at: Try it and you will see that it crashes, but runs fine if you copy and paste it to a local file and execute it locally.

My application is in use at a university and is installed on the university computer. However, the university does not permit access to their server time. I need the students' PC date to be accurate as I have code which allows linking to other websites only for a certain period (thus depending on dates) and for the display of what we call scrolling messages with announcements. The display of these announcements is also dependent on the date.

I just cannot understand that it is so difficult to read the simple character string put out by the NIST and to put it in a variable for later manipulation. I had hoped that someone would know of a solution.

Regards
DutchDFW
 
I think you have to think clearly what routine is operating on what machine, then the permission. As thing is running on the client, each and every of your client m/c's must lower their security zone setting to prompt the user's for fetching data from external source beyond user's control. If the setting is denial pure and simple, permission denied is unavoidable. I went to the page, and the browser just prompt me for my permission and that after I give my consent, it fetches the data as expected. It is because of my security zone setting.

As far as the nist is concerned, you can no problem fetch it from the server-side and send the data to the client. That is not the problem. The major problem might come when you check client's time setting without getting client's explicit consent. But, it is again the same problem and security zone setting mentioned above.

If it is on a private network, you might have to consider hta which bypass the security checking within the application and pass the burden to the log-in mechanism.
 
Thanks again, tsuji.

You are correct, it is the security setting.

I will just have to forget it and let the students suffer by not being able to access a site at a certain date. I did find several students who had the wrong date on their PCs. They just did not care. But to have them change their security settings would be altogether a hopeless task. :)

Regards
DutchDFW
 
Why not simply use a NET TIME command in a logon script ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top