411 REFERENCE · Wikibooks
Futurebasic/Language/Reference/timestring
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
TIME$
Function
(+) Appearance (+) Standard (+) Console
Syntax
currentTime$ = TIME$
Description
This function returns the current time of day as an 8-character string in this format: hh:mm:ss where hh is a 2-digit hour in 24-hour format ("00" through "23"), mm is a 2-digit minutes value ("00" through "59"), and ss is a 2-digits seconds value ("00" through "59"). Example:
This program speaks one of three appropriate phrases depending on the time of day. hour = VAL(LEFT$(TIME$,2))
SELECT CASE hour
CASE >= 18
oserr = FN SPEAKSTRING("Good evening.")
CASE >= 12
oserr = FN SPEAKSTRING("Good afternoon.")
CASE ELSE
oserr = FN SPEAKSTRING("Good morning.")
END SELECT
WHILE FN SPEECHBUSY
WEND Note:
To get a time string which is formatted according to the user's "Date & Time" preferences, use the Toolbox procedure IUTIMESTRING. For example: DIM timeStr$, @ t&
CALL GETDATETIME( t& )
CALL TIMESTRING( t&, _false, timeStr$ , _nil )
PRINT "The time is now "; timeStr$
See Also
DATE$; TIMER function