Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String formatDayFromPicker(int day, int month, int year) {
        String dayS, monthS;
        month++;

        if (day < 10) {
            dayS = "0" + String.valueOf(day);
        } else {
            dayS = String.valueOf(day);
        }

        if (month < 10) {
            monthS = "0" + String.valueOf(month);
        } else {
            monthS = String.valueOf(month);
        }

        return dayS + "/" + monthS + "/" + String.valueOf(year);
    }
}