Here you can find the source of subtractFromUTCMilliSeconds(int calendarTime, int actualValue)
Parameter | Description |
---|---|
calendarTime | the calendar time of hours/minutes/seconds |
actualValue | the value |
public static long subtractFromUTCMilliSeconds(int calendarTime, int actualValue)
//package com.java2s; /*//from ww w . j a va2s.c o m * 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 { /** * Subtract 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 subtractFromUTCMilliSeconds(int calendarTime, int actualValue) { final Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); calendar.add(calendarTime, -actualValue); return calendar.getTimeInMillis(); } }