str2Time Function [AX 2012]

Updated: December 10, 2009

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

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;
}

Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show: