Java Utililty Methods Year to String

List of utility methods to do Year to String

Description

The list of methods to do Year to String are organized into topic(s).

Method

StringYearToString(int year)
Year To String
if (year <= 0) {
    year *= -1;
    year++;
    return String.format("%dBC", year);
return Integer.toString(year);
StringyearToString(int year)
year To String
String result = Integer.toString(year);
if (result.length() < 4)
    result = "0000".substring(0, 4 - result.length()) + result;
return result;