Here you can find the source of getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second, int millisecond)
static public java.util.Calendar getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second, int millisecond)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Whizzo Software, LLC. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ import java.util.TimeZone; public class Main { static public java.util.Calendar getTimeInCurrentDay(long now, TimeZone tz, int hour, int minute, int second, int millisecond) { java.util.Calendar cal = java.util.Calendar.getInstance(tz); cal.setTimeInMillis(now);//from ww w . ja va 2 s.c o m cal.set(java.util.Calendar.HOUR_OF_DAY, hour); cal.set(java.util.Calendar.MINUTE, minute); cal.set(java.util.Calendar.SECOND, second); cal.set(java.util.Calendar.MILLISECOND, millisecond); return cal; } }