SBM ModScript Reference → Programming SBM ModScript → Object Types → TimeMillis → TimeMillis FormatDateText() Method
Formats a date into a human-readable string using built-in date formats. None of the built-in formats recognize milliseconds.
string FormatDateText( attrib ) string FormatDateText( attrib, TimeZone tz, Locale loc, int dateformat, int timeformat, int dateFormatPref )
| Parameter | Type | Description |
|---|---|---|
|
attrib |
int |
See DateTimeAttributeConstants for values. |
|
tz |
TimeZone |
Timezone used to convert the point in time represented by the TimeT to text. If not provided, the current user's timezone is used. |
|
loc |
Locale |
Locale used during formatting. Especially important if dateformat is set to DateFormatConstants.FROM_LOCALE. If not provided, the current user's preference is used. |
|
dateformat |
int |
See DateFormatConstants. Note that when the dateformat parameter is DateFormatConstants.FROM_LOCALE, the timeformat parameter is ignored. If not provided, the current user's preference is used. |
|
timeformat |
int |
See TimeFormatConstants. If not provided, the current user's preference is used. |
|
dateFormatPref |
int |
See DateFormatFromLocaleConstants. Only used when dateformat is set to DateFormatConstants.FROM_LOCALE. Indicates whether to use the terse or verbose format of the locale. If not provided, the current user's preference is used. |
| Type | Description |
|---|---|
|
string |
The date in human-readable text format. |
SBM ModScript version: 11.4.
var t = TimeMillis(1545721199278ll);
var s = t.FormatDateText( DateTimeAttributeConstants.DATETIME, CreateTimeZone("MST"),
CreateLocale("en_US"), DateFormatConstants.FROM_LOCALE, 0,
DateFormatFromLocaleConstants.FULL );
Ext.WriteStream( s );
Result:
Monday, December 24, 2018 11:59:59 PM
None.
Copyright © 2007–2020 Micro Focus or one of its affiliates. All rights reserved.