Java Day in Month getDayOfMonthSuffix(final int day)

Here you can find the source of getDayOfMonthSuffix(final int day)

Description

get Day Of Month Suffix

License

BEER-WARE LICENSE

Declaration

private final static String getDayOfMonthSuffix(final int day) 

Method Source Code

//package com.java2s;
//License from project: BEER-WARE LICENSE 

public class Main {
    private final static String[] daySuffixes =
            // 0 1 2 3 4 5 6 7 8 9
            { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th",
                    // 10 11 12 13 14 15 16 17 18 19
                    "th", "th", "th", "th", "th", "th", "th", "th", "th", "th",
                    // 20 21 22 23 24 25 26 27 28 29
                    "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th",
                    // 30 31
                    "th", "st" };

    private final static String getDayOfMonthSuffix(final int day) {
        return daySuffixes[day];
    }/*from   www .  ja va  2s  . c  om*/
}

Related

  1. getDayOfMonth(int month, int year)
  2. getDayOfMonth(long time)
  3. getDayOfMonth(Object millis)
  4. GetDayOfMonth(String aDatetime)
  5. getDayOfMonth(String dateKey)
  6. getDayOrMonth(int value)
  7. getDaysByMonth(int month)
  8. getDaysInMonth(int month, int year)
  9. getDaysInMonth(int month, int year)