TIME() - Parse Time String
Syntax
TIME(str1{,str2}{,str3}{,ERR=lineref})
Description
In BBj 24.00 and higher, the TIME() function returns a time value in the same format as the BBx TIM variable for a given time string.
Parameters
Parameter | Description |
---|---|
str1 |
Human readable time string. |
str2 |
TIME mask. If not specified, the mask from STBL("!TIME") is used. |
str3 |
Locale. If not specified, the value of STBL("!LOCALE") is used. The locale is only relevant when parsing a time string containing a localized am/pm value |
ERR=lineref |
Branch to be taken if an error occurs during execution. |
Example
READY
>precision 16
>?time("9am")
9
>?time("430pm")
16.5
>?time("1:23:45")
1.3958333333333333
>?date(0,1.3958333333333333:"%Hz:%mz:%sz")
01:23:45
>?time("1x2")
!ERROR=17 ('x' cannot be used as a separator)
>