Jump to content

Recommended Posts

Posted

Hello,

i am making a computer limit timer. But i need to check that nobody can change the systemtime. So i want to check online the time, not the date. So i found this http://worldtimeapi.org/ , but it gives to much information, i only need the time for amsterdam, so i can compare it with my systemtime.

I found another one but the site is offline http://www.timeapi.org/ . Can somebody help me with this.

 

 

Posted (edited)

 

#include <Constants.au3>

Local $String = BinaryToString(InetRead ( "http://worldtimeapi.org/api/timezone/Europe/Amsterdam",1))
Local $Time = StringRegExp ($String,'"datetime":".+?T(\d+:\d+:\d+)', $STR_REGEXPARRAYMATCH)
MsgBox ($MB_SYSTEMMODAL,"",$Time[0])

Thanks for sharing the site :)

Edited by Nine
Posted (edited)

Sorry another question how can i reset the time to the current time. People on forums says you can do it with _Date_Time_SetLocalTime($Time), but it doesn't set the system time back to the original time.

Do i need some privileges to do that.

Edited by samir500

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...