|
Other classes are used to format strings, rather than the string class itself, such as the representation of dates and currencies.
Format Date:
DateClass:
Constructor:
Date() Allocate a date object and initialize it to indicate the time (accurate to milliseconds) it is allocated ).
Date(Long date) allocates a date object and initializes this object to indicate the specified number of milliseconds since the standard reference time (EPOCH), that is, January 1, 1970 00:00:00 GMT.
Other methods:
DateformatClass:
Public abstract classDateformatExtends format
Constructor:
Dateformat() Create a New dateformat.
Other methods:
Public final stringFormat(Date) format a date as a date/time string.
Public static final dateformatGetdateinstance(INT style) Get the date formatter, which has a given format style in the default language environment
Public static final dateformatGettimeinstance() Get the time formatter, which has the Default Formatting style in the default language environment
Public static final dateformatGetdatetimeinstance() Get the date/time formatter, which has the Default Formatting style in the default language environment
Format a number:
NumberformatClass:
Public abstract classNumberformatExtends format
|
Static numberformat |
Getcurrencyinstance()
Returns the currency format of the current default language environment. |
|
Static numberformat |
Getcurrencyinstance(Locale inlocale)
Returns the currency format of the specified language environment. |
|
Static numberformat |
Getpercentinstance(Locale inlocale)
Returns the percentage format of the specified language environment. |
|