Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static long timeInMillis(int hour, int minute) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, 0); long timeBefore = calendar.getTimeInMillis(); if (Calendar.getInstance().getTimeInMillis() > timeBefore) calendar.add(Calendar.DAY_OF_WEEK, 1); return calendar.getTimeInMillis(); } }