DateDataFormat.setCustomFormat
Overview | Methods |
This Package | All Packages
Sets the custom format string.
Syntax
public void setCustomFormat( String value )
Parameters
value
The string to be used to format dates or times.
Remarks
The setting of the customFormat property is only applied when the format property is set to DateFormat.CUSTOM.
If the format property is not set to DateFormat.CUSTOM,
then the custom format string is ignored.
Use the following guidelines to specify the custom format string:
- To display months, days, hours, minutes, or seconds as numbers with no leading zeros,
use m, d, h, m, or s,
respectively.
- To display months, days, hours, minutes, or seconds as numbers with leading zeros before
single digits, use mm, dd, hh, mm,
or ss, respectively.
- To display abbreviations for the month, day, or year, use mmm, ddd,
or yy, respectively.
- To display the full name of the month, day, or year, use mmmm, dddd,
or yyyy, respectively.
- To display time according to the 12-hour clock, use either AM/PM, am/pm,
A/P, or a/p. (To display the default AM/PM symbol that
is defined by your system settings, use AMPM.)
- To display static text within the format string, enclose the text in single quotation
marks ('). Date and time symbols, such as the slash (/) and colon (:), do not require
quotation marks. For example:
'The date is' m/d/yy
See Also getCustomFormat