Here you can find the source of date(int year, int month, int day, int hour, int minute, int second)
public static Date date(int year, int month, int day, int hour, int minute, int second)
//package com.java2s; /*/*from ww w . j ava 2s . c om*/ * Debrief - the Open Source Maritime Analysis Application * http://debrief.info * * (C) 2000-2014, PlanetMayo Ltd * * This library is free software; you can redistribute it and/or * modify it under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html) * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ import java.util.Calendar; import java.util.Date; public class Main { public static Date date(int year, int month, int day, int hour, int minute, int second) { Calendar calendar = Calendar.getInstance(); calendar.set(year, month, day, hour, minute, second); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } public static Date date(int year, int month, int day) { return date(year, month, day, 0, 0, 0); } }