GLBasic forum

Main forum => GLBasic - en => Topic started by: djtoon on 2011-Jan-30

Title: get current time from iphone?
Post by: djtoon on 2011-Jan-30
is there a way?
10x
Title: Re: get current time from iphone?
Post by: BdR on 2011-Jan-30
The command PLATFORMINFO$("TIME") will return a string with the date and time, for example "2011-01-30 23:59:45". You can get the year, month, hours etc. like this:

Code (glbasic) Select
LOCAL str$
LOCAL iDay%, iMonth%, iYear%
LOCAL iHour%, iMin%, iSec%

str$ = PLATFORMINFO$("TIME")

iYear  = MID$(str$, 0, 4)
iMonth = MID$(str$, 5, 2)
iDay   = MID$(str$, 8, 2)

iHour = MID$(str$, 11, 2)
iMin  = MID$(str$, 14, 2)
iSec  = MID$(str$, 17, 2)
Title: Re: get current time from iphone?
Post by: Marmor on 2011-Jan-30
lol iYear,Imonth,Iday ,Ihour,Imin;isec  what a fanboy  :D
Title: Re: get current time from iphone?
Post by: BdR on 2011-Jan-30
I'm definitely no Apple fanboy. :| The "i" for each variable name stand for "integer"  and it's a coding convention I've been using since back in the 90s with pascal and vb... Try googling Hungarian notation
Title: Re: get current time from iphone?
Post by: Marmor on 2011-Jan-30
he its a joke u know  :D  bad joke but a joke  peace
Title: Re: get current time from iphone?
Post by: BdR on 2011-Jan-30
ok np it's hard to tell the tone from just text :P