Here you can find the source of setCalendarTime(Calendar inCalendar, int hr, int min, int sec, int milliSec)
Parameter | Description |
---|---|
inCalendar | a parameter |
hr | a parameter |
min | a parameter |
sec | a parameter |
milliSec | a parameter |
public static void setCalendarTime(Calendar inCalendar, int hr, int min, int sec, int milliSec)
//package com.java2s; /*/* ww w .j a va 2 s.c o m*/ * @(#)Utility.java * * Copyright (c) 2003 DCIVision Ltd * All rights reserved. * * This software is the confidential and proprietary information of DCIVision * Ltd ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the license * agreement you entered into with DCIVision Ltd. */ import java.util.Calendar; public class Main { /** * Call this function to set the time section of a calendar * * @param inCalendar * @param hr * @param min * @param sec * @param milliSec */ public static void setCalendarTime(Calendar inCalendar, int hr, int min, int sec, int milliSec) { if (inCalendar != null) { if (hr != -1) { inCalendar.set(Calendar.HOUR_OF_DAY, hr); } if (min != -1) { inCalendar.set(Calendar.MINUTE, min); } if (sec != -1) { inCalendar.set(Calendar.SECOND, sec); } if (milliSec != -1) { inCalendar.set(Calendar.MILLISECOND, milliSec); } } } }