Get List of Weekday Names in Java

In this post, we will see how to get list of weekday names in Java.

Using DateFormatSymbols’s getWeekdays() method

We can use DateFormatSymbols's getWeekdays() to get list of weekday names in Java. It will provide complete weekday names like Sunday, Monday etc.

Output

Using DateFormatSymbols’s getShortWeekdays() method [For short names]

If you need short names rather than complete weekdays name, you can use DateFormatSymbols's getShortWeekdays().

Output

Using DateFormatSymbols’s getWeekdays() with Locale

If you are looking for weekday names in different Locale like German or French, you can specify Locale while creating object of DateFormatSymbols. It will work for both methods i.e. getWeekdays() and getShortWeekdays().

Output

That’s all about how to get list of months in Java.

Was this post helpful?

Related Posts

  • 26 November

    Check if Date Is Between Two Dates in Java

    Table of ContentsIntroductionDate & Local Date Class in JavaCheck if The Date Is Between Two Dates in JavaUsing the isAfter() and isBefore() Methods of the Local Date Class in JavaUsing the compareTo() Method of the Local Date Class in JavaUsing the after() and before() Methods of the Date Class in JavaUsing the compare To() Method […]

  • 05 October

    Find Difference Between Two Instant in Java

    Table of ContentsWays to find difference between two Instant in JavaUsing Instant’s until() methodUsing ChronoUnit EnumUsing Duration’s between() method In this post, we will see how to find difference between two Instant in Java. Ways to find difference between two Instant in Java There are multiple ways to find difference between two Instant in various […]

  • 05 October

    Find Difference Between Two LocalDate in Java

    Table of ContentsWays to find difference between two LocalDate in JavaUsing LocalDate’s until() methodUsing ChronoUnit EnumUsing Duration’s between() methodUsing Period’s between() methodFrequently asked questionsHow to find difference between two LocalDate in Java in Days?How to find difference between two LocalDate in Java in Years?How to find difference between two LocalDate in Java in Months?How to […]

  • 24 September

    Get List of Month Names in Java

    Table of ContentsUsing DateFormatSymbols’s getMonth() methodUsing DateFormatSymbols’s getShortMonths() method [ For short names]Using DateFormatSymbols’s getMonth() with Locale In this post, we will see how to get list of months name in Java. Using DateFormatSymbols’s getMonth() method We can use DateFormatSymbols's getMonth() to get list of months in Java. It will provide complete month names like […]

  • 20 September

    Get Unix Timestamp in Java

    Table of ContentsWays to get unix timestamp in JavaUsing Instant classUsing System.currentTimeMillis()Using Date’s getTime() methodConvert Date to unix timestamp in JavaUsing Instant classUsing Date’s getTime() method In this post, we will get unix timestamp in Java. As per wikipedia Unix time is a system for describing a point in time. It is the number of […]

  • 17 September

    Check if Date Is Weekend or Weekday in Java

    Table of ContentsUsing LocalDate’s getDayOfWeek() methodUsing LocalDate with DayOfWeekUsing Date and Calendar classes In this post, we will see how to check if Date is weekend or weekday in Java. Please note that we will consider Saturaday/Sunday as weekend and rest five days of week as weekdays. Using LocalDate’s getDayOfWeek() method We can use LocalDate’s […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.