Here you can find the source of createTimestamp(int year, int month, int day, int hour, int minutes, int seconds)
public static long createTimestamp(int year, int month, int day, int hour, int minutes, int seconds)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static long createTimestamp(int year, int month, int day, int hour, int minutes, int seconds) { Calendar calendar = Calendar.getInstance(); calendar.clear();//from ww w . ja v a 2 s .c o m calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1); calendar.set(Calendar.DAY_OF_MONTH, day); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minutes); calendar.set(Calendar.SECOND, seconds); return calendar.getTimeInMillis(); } }