Here you can find the source of time2InicioDelDia(Calendar fecha)
public static void time2InicioDelDia(Calendar fecha)
//package com.java2s; /*/* www . j a v a 2s .co m*/ * SAME - Sistema de Gestion de Turnos por Internet * SAME is a fork of SAE - Sistema de Agenda Electronica * * Copyright (C) 2009 IMM - Intendencia Municipal de Montevideo * Copyright (C) 2013, 2014 SAGANT - Codestra S.R.L. * Copyright (C) 2013, 2014 Alvaro Rettich <alvaro@sagant.com> * Copyright (C) 2013, 2014 Carlos Gutierrez <carlos@sagant.com> * Copyright (C) 2013, 2014 Victor Dumas <victor@sagant.com> * * This file is part of SAME. * SAME is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.util.Calendar; import java.util.Date; public class Main { public static Date time2InicioDelDia(Date fecha) { Calendar cal = Calendar.getInstance(); cal.setTime(fecha); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } public static void time2InicioDelDia(Calendar fecha) { fecha.set(Calendar.HOUR_OF_DAY, 0); fecha.set(Calendar.MINUTE, 0); fecha.set(Calendar.SECOND, 0); fecha.set(Calendar.MILLISECOND, 0); } }