Java Year to String yearToString(int year)

Here you can find the source of yearToString(int year)

Description

year To String

License

Open Source License

Declaration

private static String yearToString(int year) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static String yearToString(int year) {
        String result = Integer.toString(year);
        if (result.length() < 4)
            result = "0000".substring(0, 4 - result.length()) + result;
        return result;
    }//from   w  ww.  j  av  a 2  s. c o m
}

Related

  1. YearToString(int year)