Here you can find the source of getTime(TimeZone tz, int year, int month, int day, int hour, int minute, int second)
static public long getTime(TimeZone tz, int year, int month, int day, int hour, int minute, int second)
//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.Calendar; import java.util.TimeZone; public class Main { static public long getTime(TimeZone tz, int year, int month, int day, int hour, int minute, int second) { Calendar c = Calendar.getInstance(tz); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month - 1); c.set(Calendar.DAY_OF_MONTH, day); c.set(Calendar.HOUR_OF_DAY, hour); c.set(Calendar.MINUTE, minute); c.set(Calendar.SECOND, second); c.set(Calendar.MILLISECOND, 0); return c.getTimeInMillis(); }//w ww . j a v a 2 s . co m }