SBM ModScript Reference → Programming SBM ModScript → Object Types → TimeMillis → 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.
void ParseDateText( value, int attrib ) void ParseDateText( value, int attrib, TimeZone tz, Locale loc, int dateformat, int timeformat )
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. |
Type | Description |
---|---|
None |
SBM ModScript version: 11.4.
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
None.
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.