Android Year Format yemodaToString(int year, int month, int day)

Here you can find the source of yemodaToString(int year, int month, int day)

Description

yemoda To String

Declaration

public static String yemodaToString(int year, int month, int day) 

Method Source Code

//package com.java2s;

public class Main {
    public static String yemodaToString(int year, int month, int day) {
        int moplus1 = month + 1;

        String mo = Integer.toString(moplus1);

        if (moplus1 < 10) {
            mo = "0" + mo;
        }/* www.j  a v a 2 s  .  com*/

        String da = Integer.toString(day);

        if (day < 10) {
            da = "0" + da;
        }

        String ye = Integer.toString(year);

        return mo + "-" + da + "-" + ye;
    }
}