Java Calendar Add addToUTCMilliSeconds(int calendarTime, int actualValue)

Here you can find the source of addToUTCMilliSeconds(int calendarTime, int actualValue)

Description

Add given minutes/hours/seconds to actual calendar time.

License

Open Source License

Parameter

Parameter Description
calendarTime the calendar time of hours/minutes/seconds
actualValue the value

Return

long

Declaration

public static long addToUTCMilliSeconds(int calendarTime, int actualValue) 

Method Source Code

//package com.java2s;
/*/*from ww w.  jav a  2  s. c om*/
 * DateUtil.java
 * Copyright (c) 2014, EcoFactor, All Rights Reserved.
 *
 * This software is the confidential and proprietary information of EcoFactor
 * ("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
 * EcoFactor.
 */

import java.util.Calendar;

import java.util.TimeZone;

public class Main {
    /**
     * Add given minutes/hours/seconds to actual calendar time.
     * @param calendarTime the calendar time of hours/minutes/seconds
     * @param actualValue the value
     * @return long
     */
    public static long addToUTCMilliSeconds(int calendarTime, int actualValue) {

        final Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
        calendar.add(calendarTime, actualValue);
        return calendar.getTimeInMillis();
    }
}

Related

  1. addLocaleToCalendar(Calendar date, String locale)
  2. addMilliseconds(Calendar calendar, Long amount)
  3. addMonth(Calendar cal, int period)
  4. addMonthDayToCal(Calendar cal, int month, int day)
  5. addSeconds(Calendar calendar, int amount)
  6. addWeekdays(Calendar cal, int days)
  7. addWorkdays(final Calendar calendar, final int dauer)
  8. appendDate(StringBuffer buf, Calendar cal)
  9. appendDate(StringBuffer dateString, Calendar calendar)