TimeMillis ParseDateText() Method

Parses a human-readable date string into a TimeMillis using built-in date formats. None of the built-in formats recognize milliseconds.

Function Signature

 void ParseDateText( value, int attrib )

void ParseDateText( value, int attrib, TimeZone tz, Locale loc, int dateformat, 
                    int timeformat )

Parameters

Parameter Type Description

value

string

The text to parse.

attrib

int

See DateTimeAttributeConstants for values.

tz

TimeZone

The time zone used to determine the point in time represented by the text. If not provided, the current user's time zone is used.

loc

Locale

The locale used during parsing. Especially important if dateformat is set to DateFormatConstants.FROM_LOCALE. Helps identify keywords such as "AM" and "PM".

dateformat

int

The date format. See DateFormatConstants.

timeformat

int

The time format. See TimeFormatConstants. Ignored if dateformat is DateFormatConstants.FROM_LOCALE.

Return

Type Description

None

Technical Details

SBM ModScript version: 11.4.

Example

var t = TimeMillis();
t.ParseDateText( "12/24/2018 11:59:59 pm", DateTimeAttributeConstants.DATETIME,
  CreateTimeZone("MST"), CreateLocale("en_US"), DateFormatConstants.MM_DD_YYYY, 
  TimeFormatConstants.TWELVE_HOUR );
Ext.WriteStream( t.date ); 

Result:

1545721199000

Notes

None.

Related Topics

TimeMillis