Create Timestamp
import java.util.Calendar;
import java.util.GregorianCalendar;
class Main {
public static long createTimestamp(int year, int month, int day) {
Calendar cal = new GregorianCalendar(year, month, day);
long timestamp = cal.getTime().getTime();
int offset = cal.getTimeZone().getOffset(timestamp);
return timestamp + offset;
}
}
Related examples in the same category