java.text Code Samples
- How do I convert String to Date object?
- How do I format a number?
- How do I convert Date to String?
- How do I format a date into dd/mm/yyyy?
- How do I format a date-time value?
- How do I format a number with leading zeros?
- How do I format date using a locale based format?
- How do I get a list of month names?
- How do I get a list of weekday names?
- How do I sort strings using Collator class?
- How do I format a message that contains date information?
- How do I format a number for a locale?
- How do I iterate each characters of a string?
- How do I parse a number for a locale?
Page 1 of 3 |
Prev
|
Next
How do I get a list of weekday names?
The example code below helps you to get all weekday names as an array of String. The first method, getWeekdays() return the full name string while the second method getShortWeekdays() return the short name of the weekday.
The result of the code above are:
weekday = Sunday weekday = Monday weekday = Tuesday weekday = Wednesday weekday = Thursday weekday = Friday weekday = Saturday shortWeekday = Sun shortWeekday = Mon shortWeekday = Tue shortWeekday = Wed shortWeekday = Thu shortWeekday = Fri shortWeekday = Sat