Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    /**
     * Returns Epoch date, ie. 01/01/1970.
     *
     * @return Epoch date, ie. 01/01/1970.
     */
    public static Date getEpoch() {
        final Calendar calendar = Calendar.getInstance();

        calendar.clear();
        calendar.set(1970, 0, 1);

        return calendar.getTime();
    }
}