Java tutorial
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static long date2long(int hour, int minute, int second) { Calendar c = Calendar.getInstance(); c.set(Calendar.HOUR_OF_DAY, 18); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); Date d = c.getTime(); return d.getTime(); } }