Here you can find the source of getUnixEpochDateTime()
public static Date getUnixEpochDateTime()
//package com.java2s; /**//from w w w. j a va2s.co m * * Licensed under the Microsoft Public License (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://opensource.org/licenses/MS-PL * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { /** * Returns the starting Unix Epoch Time. * @return the Unix Epoch Time. */ public static Date getUnixEpochDateTime() { Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); calendar.set(1970, 0, 1, 0, 0, 0); return calendar.getTime(); } }