str2Time Function

Converts a string to a timeOfDay value.


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 the _text parameter; otherwise, -1.

  • 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: