get current time from iphone?

Previous topic - Next topic

djtoon


BdR

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)

Marmor

lol iYear,Imonth,Iday ,Ihour,Imin;isec  what a fanboy  :D

BdR

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

Marmor

he its a joke u know  :D  bad joke but a joke  peace

BdR

ok np it's hard to tell the tone from just text :P