Post about your Basic project here

Moderator: Mmiscool

User avatar
By Mmiscool
#35289 Currently there is a time function. Please note that this will most likely be changing in future builds.

There is no way to set a time zone yet either.

Code: Select allprint time()
User avatar
By heckler
#35316 Wow! that's cool!

So is it possible to parse the returned time using any of the string functions?
or to act on, say the hours value, and do an ... if time() > 4 then dosomething
or something similar??

If so could you please show a quick example so I can understand the syntax and how to properly use the time in a program.

For me it always seems to be the syntax of a given programming language that trips me up the most.

examples help A LOT !!

Also what time zone is it in?? where does the time value come from??

thanks
dwight
User avatar
By Mmiscool
#35317 Well it is not quite there yet. The string could be parced by the string functions but there will be better functions that support what you want to do latter. I think rotohammer had some thing cooking for this.

For now if you do
Code: Select allPrint time()
it will give you the time and date as a string.

You can also put the time in to a variable that can be parced.
Code: Select allBla = time()
User avatar
By heckler
#35323 Thanks mmiscool!

here is my simple time parser... (please use as an example if desired)

question... where is the time coming from??

thanks
dwight

Code: Select allmemclear
cls
button "GetTime" [GetTime]
button "Exit " [Exit]
wait
[GetTime]
print time()
bla = time()

dw = mid(bla,1,3) 'dow
mh = mid(bla,5,3) 'month
dt = mid(bla,9,2) 'date
hh = mid(bla,12,2) 'hour
mm = mid(bla,15,2) 'min
ss = mid(bla,18,2) 'sec
yr = mid(bla,21,4) 'year

print dw
print mh
print dt
print hh
print mm
print ss
print yr
print
print "Heap"
print flashfree() 'how much mem left
wait
[Exit]
end