Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    private static DateFormat dateMonthHourMinuteDateFormat;

    public static String getDateMonthHourMinuteDateToUser(Date date) {
        if (date != null) {
            return getDateMonthHourMinuteDateFormat().format(date);
        } else {
            return "";
        }
    }

    private static DateFormat getDateMonthHourMinuteDateFormat() {
        if (dateMonthHourMinuteDateFormat == null) {
            dateMonthHourMinuteDateFormat = new SimpleDateFormat("dd/MM' - 'HH:mm", new Locale("pt", "BR"));
        }
        return dateMonthHourMinuteDateFormat;
    }
}