December 1999
Intermediate to advanced
816 pages
20h 27m
English
Just as it is possible to format numbers and currency, it is possible with classes from java.text to format dates and times.
The principles are essentially the same as formatting numbers, so I'll get right to the code. Listing 18.5 shows how to format dates and times using both predefined, locale-sensitive formats, and creating custom formats for locale-independent formats.
// Program to format data with help from java.text import java.text.*; import java.util.*; class DateShaper { Locale usLocale; Locale deLocale; DateFormat usDateFormatter; DateFormat deDateFormatter; String formattedDate; Date ... |
Read now
Unlock full access