Java Calendar Adjust adjustedMillis(Calendar cal)

Here you can find the source of adjustedMillis(Calendar cal)

Description

Gets the time in milliseconds from a Calendar, adjusting for timezone so that day subtraction works properly.

License

Open Source License

Declaration

private static long adjustedMillis(Calendar cal) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    /**/* w ww .  j  a  v  a  2 s  .  c o m*/
     * Gets the time in milliseconds from a Calendar, adjusting for timezone
     * so that day subtraction works properly.
     */
    private static long adjustedMillis(Calendar cal) {
        return cal.getTimeInMillis() + cal.getTimeZone().getOffset(cal.getTimeInMillis());
    }
}

Related

  1. adjustCalendar(Calendar calendar)
  2. adjustCalendarToLocalTime(Calendar cal)
  3. adjustDate(Calendar calendar, int differenceInDay)
  4. adjustToDayEnd(Calendar cal)
  5. adjustToFieldStart(Calendar cal, int[] fields)
  6. adjustToMonthStart(Calendar cal)
  7. getMidnightCalendarByUnadjustedDate(Date date, TimeZone timezone)