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.util.Calendar;
import java.util.Date;

public class Main {
    /**
     * Returns the date
     * @param timestamp This is the long milliseconds date since epoch
     * @return Returns a date object
     */
    public static Date getDate(Long timestamp) {
        if (timestamp == null)
            return null;
        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(timestamp);
        return cal.getTime();
    }
}