defineTimeFormat

defineTimeFormat(showAs12HourClock:   Boolean;
                 showLeadingZero:     Boolean;
                 showAmPmSuffix:      Boolean;
                 textAm:              String;
                 textPm:              String;
                 hourMinSecSeparator: String;
                 showSecs:            Boolean) updating;

The defineTimeFormat method of the TimeFormat class enables you to dynamically define the characteristics of a time format. (For details about returning a string containing the receiver in the supplied time format, see the Time primitive type userFormat method.)

Set the showAs12HourClock parameter to true if you want to display a 12-hour time. Alternatively, set this parameter to false if you want to display a 24-hour time.

Set the showLeadingZero parameter to true if you want to display a leading zero (0) for hours less than 10. Alternatively, set this parameter to false if you do not want to display a leading zero.

Set the showAmPmSuffix parameter to true if you want to display a time marker (for example, am or pm) after the time in 12-hour format. Alternatively, set this parameter to false if you do not want to display a time marker after the time (for example, when the time format is specified as 24-hour format).

The textAm and textPm parameters enable you to specify a string of up to 30 characters that is to be displayed for times before midday and after midday, respectively. If the strings are longer than 30 characters, they are truncated to 30 characters.

Use the hourMinSecSeparator parameter to specify a string of up to 10 characters that contains the text to be displayed between the hours and seconds. If the string contains any of the d, M, y, g, h, H, m, s, or t characters, these characters are removed. If the string is longer than 10 characters, it is truncated to 10 characters.

Set the showSecs parameter to true if you want to display a seconds. Alternatively, set this parameter to false if you do not want to display seconds.