aa2zz6

Website Timestamp

4 posts in this topic

#1 ·  Posted

I'm trying to gather a timestamp from another timezone but my results isn't displaying from what's on the website. I figured the inetread would pull the current timestamp and display the time using a consolewrite.

Local $timeStamp = InetRead("https://time.is/UTC")
ConsoleWrite("Current Time: " & $timeStamp)

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

Looks like the site adjusted the time for the current timezone. Here a thread where multiple options are offered for retrieving the time --

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks Danp2

I found this piece on the AutoIt forums that helped.

This piece in particular help 

; Convert system time to local time
    $tSystem = _Date_Time_GetSystemTime()
    $tLocal = _Date_Time_SystemTimeToTzSpecificLocalTime($tSystem)

https://www.autoitscript.com/autoit3/docs/libfunctions/_Date_Time_TzSpecificLocalTimeToSystemTime.htm

 

Edited by aa2zz6

Share this post


Link to post
Share on other sites

#4 ·  Posted

$timestamp = BinaryToString(InetRead('http://www.convert-unix-time.com/api?timestamp=now'))

Try this ^^

 

Share this post


Link to post
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