Java Calendar Time getCalendarWithoutTimeZone(Date date)

Here you can find the source of getCalendarWithoutTimeZone(Date date)

Description

Returns a Calendar with no time zone

License

Open Source License

Parameter

Parameter Description
date The Date to convert to Calendar

Return

the Calendar

Declaration

public static Calendar getCalendarWithoutTimeZone(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    /**/*from  w w w  .ja v a2s .c o m*/
     * Returns a Calendar with no time zone
     * @param date The Date to convert to Calendar
     * @return the Calendar
     */
    public static Calendar getCalendarWithoutTimeZone(Date date) {
        if (date == null) {
            return null;
        }
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.clear(Calendar.ZONE_OFFSET);
        return cal;
    }
}

Related

  1. currentTimeAsCalendar()
  2. dateTimeToFMDateTime(Calendar dateTime)
  3. elapsedTime(Calendar before, Calendar after)
  4. equalizeTime(final Calendar toEqualize, final Calendar source)
  5. equalsIgnoreTimeZone(final Calendar c1, final Calendar c2)
  6. getClientCurrentDate(final Calendar calendar, final TimeZone timeZone)
  7. getCurrentTimeDecimal(Calendar cal)
  8. getCurrentTimeIfCalendareIsNull(Calendar testDate)
  9. getCurrentTimeLongType(Calendar cal)