str2Date Function

Converts a text string to a date.


date str2Date(str _text, str _sequence)

Parameter

Description

_text

The text string to convert to a date.

_sequence

The desired sequence in the date:

  • day: 1

  • month: 2

  • year: 3

For example, if the desired sequence is month, year, day, _sequence is written as 231.

The date specified by text, with the day, month, and year in the order specified by _sequence.

If the text string does not contain a valid date, the return value of str2date is a zero date. For example, str2Date("the 24.12.89",123) returns a zero date because this date is not valid.

static void str2DateExample(Args _arg)
{
    date d;
    ;
    d = str2Date("01/01/1999", 123);
    print d;
    pause;
} 

Community Additions

ADD
Show: