Jump to content

Time Api


samir500
 Share

Recommended Posts

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.

 

 

Link to comment
Share on other sites

 

#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
Link to comment
Share on other sites

15 hours ago, Nine said:

 

#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 :)

LOL and thank you for helping me out with the script bro :D

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...