Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final SimpleDateFormat formatter0 = new SimpleDateFormat("yyyy.MM.dd HH:mm");
    private static Date date = new Date();

    public static String formatDate(long milliseconds) {
        Date time = getDate();
        time.setTime(milliseconds);
        return formatter0.format(time);
    }

    private static Date getDate() {
        if (null == date) {
            date = new Date();
        }
        return date;
    }
}