str2Time Function

Converts text to an integer value. The integer value represents the number of seconds elapsed since midnight until the time specified in the text string.


int str2Time(str _text)

Parameter

Description

_text

The time to use to calculate the number of seconds since midnight.

The number of seconds between midnight and _text. The function returns -1 if the text does not contain a valid time. For example:

  • str2Time("05:01:37") returns the value 18097.

  • str2Time("7 o'clock") returns the value -1.

static void str2TimeExample(Args _arg)
{
    int i;
    ;
    i = str2Time("11:30");
    print i;
    pause;
}

Community Additions

ADD
Show: