DateTimePicker.getCustomFormat

Overview | Methods | This Package | All Packages

DateTimePicker.getCustomFormat

Retrieves a format string that specifies the custom format used by the control to display date and time information.

Syntax

public final String getCustomFormat()

Return Value

Returns a custom format string that is created by combining format characters from the following table. Nonformat characters in the output string are enclosed in single quotation marks. For example, if the output of the date and time picker looks like "The current time and date is: 05:31:42 Wednesday Apr 07, 1999", this method returns the following format string: "'The current time and date is: 'hh':'mm':'ss ddddMMMdd', 'yyy".

Format Characters Description
d The one- or two-digit day.
dd The two-digit day. Single digit day values are preceded by a zero.
ddd The three-character day-of-week abbreviation.
dddd The full day-of-week name.
h The one- or two-digit hour in 12-hour format.
hh The two-digit hour in 12-hour format. Single digit values are preceded by a zero.
H The one- or two-digit hour in 24-hour format.
HH The two-digit hour in 24-hour format. Single digit values are preceded by a zero.
m The one- or two-digit minute.
mm The two-digit minute. Single digit values are preceded by a zero.
M The one- or two-digit month number.
MM The two-digit month number. Single digit values are preceded by a zero.
MMM The three-character month abbreviation.
MMMM The full month name.
s The one- or two- digit seconds.
ss The two-digit seconds. Single digit values are preceded by a zero.
t The one-letter AM/PM abbreviation (that is, "AM" is displayed as "A").
tt The two-letter AM/PM abbreviation (that is, "AM" is displayed as "AM").
X A callback field that gives programmer control over the displayed field (see below.) Multiple X characters can be used in a series to signify unique callback fields.
y The one-digit year (that is, 1996 is displayed as "6").
yy The last two digits of the year (that is, 1996 is displayed as "96").
yyy The full year (that is, 1996 is displayed as "1996").