private static final long HOUR = 1000 * 60 * 60;
private static final long DAY = 1000 * 60 * 60 * 24;
private static final long WEEK = 1000 * 60 * 60 * 24 * 7;
intervall = DAY;
offset = getOffset(DAY);
private long getOffset(long interval){
long sysTime = System.currentTimeMillis() + TimeZone.getDefault().getRawOffset();
long delay = interval - sysTime % interval;
return delay;
}