Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Date;

public class Main {
    /**
     * Convert a Date object in a string representing the date at readable style.
     */
    public static String dateToReadableString(Date date) {
        if (date == null)
            return "";
        else
            return ("" + (date.getYear() + 1900) + "/" + (date.getMonth() + 1) + "/" + date.getDate());
    }
}