Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    private static SimpleDateFormat mDateFormatter;

    public static String formatDate(Date date) {
        if (date != null) {
            if (mDateFormatter == null) {
                mDateFormatter = new SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.US);
            }
            return mDateFormatter.format(date);
        } else {
            return "No update date";
        }
    }
}