Current News

Moderator: Mmiscool

User avatar
By Mmiscool
#35753 Possibly put the time set up command at the top of your program followed by a delay. That way it has some time to fetch the internet time.

Then display the time.
User avatar
By forlotto
#35754 I missed your question totally my apologies...

My mind picked out that you were still trying to do string functions with mid not time zone functions...

There is also the time set up function. This allows for setting the time zone and also can toggle daylight savings time.
To set the time zone to New York, (EST) you would use the following code. The 0 is to specify if daylight savings is to be activated.
Code: Select alltimesetup(-3,0)
delay 5000
print time()
end
Last edited by forlotto on Sun Dec 06, 2015 7:57 pm, edited 1 time in total.
User avatar
By Mmiscool
#35756 It seems like if there i no delay between the time set and using the time funtion it will display date and time from the 1970s.

Code: Select alltimesetup(-3,0)
button "Show Me the Time" [timeshow]
wait

[timeshow]
print time()
wait


This will also work
Code: Select alltimesetup(-3,0)
delay 5000
print time()
end
User avatar
By heckler
#35759 That was the fix!!
Code: Select allmemclear
timesetup(-7,0)
delay 1000
'
[GetTime]
cls  'do this to clear the webpage buffer
button "GetTime" [GetTime]
button "Exit " [Exit]
print time()
wait
'
[Exit]
end

Works a treat :D

You may want to consider noting that in the documentation to save others the same frustration.
(unless you can figure out why the delay is needed and correct it)
But it's working :mrgreen:

thanks!
dwight
Last edited by heckler on Sat Dec 05, 2015 5:39 pm, edited 1 time in total.