SBM ModScript Reference → Programming SBM ModScript → Object Types → TimeT → TimeT FormatDateText() Method
Formats a date into a human-readable string using built-in date formats.
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.3.
var t = TimeT(1545721199ll); 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–2019 Micro Focus or one of its affiliates. All rights reserved.