/** * Determines if the specified date is in daylight time according to * this timezone. This is done by finding the latest supporting * observance for the specified date and identifying whether it is * daylight time. * @param date a date instance * @return true if the specified date is in daylight time, otherwise false */ public final boolean inDaylightTime(final Date date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); return (observance != null && observance instanceof Daylight); }
/** * Determines if the specified date is in daylight time according to * this timezone. This is done by finding the latest supporting * observance for the specified date and identifying whether it is * daylight time. * * @param date a date instance * @return true if the specified date is in daylight time, otherwise false */ public final boolean inDaylightTime(final Date date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); return (observance != null && observance instanceof Daylight); }
/** * Determines if the specified date is in daylight time according to * this timezone. This is done by finding the latest supporting * observance for the specified date and identifying whether it is * daylight time. * * @param date a date instance * @return true if the specified date is in daylight time, otherwise false */ public final boolean inDaylightTime(final Date date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); return (observance instanceof Daylight); }
/** * Determines if the specified date is in daylight time according to * this timezone. This is done by finding the latest supporting * observance for the specified date and identifying whether it is * daylight time. * * @param date a date instance * @return true if the specified date is in daylight time, otherwise false */ public final boolean inDaylightTime(final Date date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); return (observance instanceof Daylight); }
/** * Determines if the specified date is in daylight time according to * this timezone. This is done by finding the latest supporting * observance for the specified date and identifying whether it is * daylight time. * * @param date a date instance * @return true if the specified date is in daylight time, otherwise false */ public final boolean inDaylightTime(final Date date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); return (observance != null && observance instanceof Daylight); }
/** * {@inheritDoc} */ public final int getOffset(final int era, final int year, final int month, final int day, final int dayOfWeek, final int milliseconds) { final Calendar cal = Calendar.getInstance(); cal.set(Calendar.ERA, era); cal.set(Calendar.YEAR, year); cal.set(Calendar.MONTH, month); cal.set(Calendar.DAY_OF_YEAR, day); cal.set(Calendar.DAY_OF_WEEK, dayOfWeek); cal.set(Calendar.MILLISECOND, milliseconds); final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); return (int) offset.getOffset().getOffset(); } return 0; }
/** * {@inheritDoc} */ public final int getOffset(final int era, final int year, final int month, final int dayOfMonth, final int dayOfWeek, final int milliseconds) { // calculate time of day int ms = milliseconds; final int hour = ms / 3600000; ms -= hour * 3600000; final int minute = ms / 60000; ms -= minute * 60000; final int second = ms / 1000; ms -= second * 1000; final Calendar cal = Calendar.getInstance(); cal.clear(); // don't retain current date/time, it may disturb the calculation // set date and time cal.set(Calendar.ERA, era); cal.set(Calendar.DAY_OF_WEEK, dayOfWeek); cal.set(year, month, dayOfMonth, hour, minute, second); cal.set(Calendar.MILLISECOND, ms); final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); return (int) (offset.getOffset().getTotalSeconds() * 1000L); } return 0; }
/** * {@inheritDoc} */ public final int getOffset(final int era, final int year, final int month, final int dayOfMonth, final int dayOfWeek, final int milliseconds) { // calculate time of day int ms = milliseconds; final int hour = ms / 3600000; ms -= hour * 3600000; final int minute = ms / 60000; ms -= minute * 60000; final int second = ms / 1000; ms -= second * 1000; final Calendar cal = Calendar.getInstance(); cal.clear(); // don't retain current date/time, it may disturb the calculation // set date and time cal.set(Calendar.ERA, era); cal.set(Calendar.DAY_OF_WEEK, dayOfWeek); cal.set(year, month, dayOfMonth, hour, minute, second); cal.set(Calendar.MILLISECOND, ms); final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); return (int) offset.getOffset().getOffset(); } return 0; }
/** * {@inheritDoc} */ public final int getOffset(final int era, final int year, final int month, final int dayOfMonth, final int dayOfWeek, final int milliseconds) { // calculate time of day int ms = milliseconds; final int hour = ms / 3600000; ms -= hour * 3600000; final int minute = ms / 60000; ms -= minute * 60000; final int second = ms / 1000; ms -= second * 1000; final Calendar cal = Calendar.getInstance(); cal.clear(); // don't retain current date/time, it may disturb the calculation // set date and time cal.set(Calendar.ERA, era); cal.set(Calendar.DAY_OF_WEEK, dayOfWeek); cal.set(year, month, dayOfMonth, hour, minute, second); cal.set(Calendar.MILLISECOND, ms); final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); return (int) (offset.getOffset().getTotalSeconds() * 1000L); } return 0; }
/** * {@inheritDoc} */ public final int getOffset(final int era, final int year, final int month, final int dayOfMonth, final int dayOfWeek, final int milliseconds) { // calculate time of day int ms = milliseconds; final int hour = ms / 3600000; ms -= hour * 3600000; final int minute = ms / 60000; ms -= minute * 60000; final int second = ms / 1000; ms -= second * 1000; final Calendar cal = Calendar.getInstance(); cal.clear(); // don't retain current date/time, it may disturb the calculation // set date and time cal.set(Calendar.ERA, era); cal.set(Calendar.DAY_OF_WEEK, dayOfWeek); cal.set(year, month, dayOfMonth, hour, minute, second); cal.set(Calendar.MILLISECOND, ms); final Observance observance = vTimeZone.getApplicableObservance(new DateTime(cal.getTime())); if (observance != null) { final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); return (int) offset.getOffset().getOffset(); } return 0; }
/** * {@inheritDoc} */ public int getOffset(long date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); if (observance != null) { final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); if ((offset.getOffset().getTotalSeconds() * 1000L) < getRawOffset()) { return getRawOffset(); } else { return (int) (offset.getOffset().getTotalSeconds() * 1000L); } } return 0; }
/** * {@inheritDoc} */ public int getOffset(long date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); if (observance != null) { final TzOffsetTo offset = observance.getProperty(Property.TZOFFSETTO); if ((offset.getOffset().getTotalSeconds() * 1000L) < getRawOffset()) { return getRawOffset(); } else { return (int) (offset.getOffset().getTotalSeconds() * 1000L); } } return 0; }
/** * {@inheritDoc} */ public int getOffset(long date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); if (observance != null) { final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); if (offset.getOffset().getOffset() < getRawOffset()) { return getRawOffset(); } else { return (int) offset.getOffset().getOffset(); } } return 0; }
/** * {@inheritDoc} */ public int getOffset(long date) { final Observance observance = vTimeZone.getApplicableObservance(new DateTime(date)); if (observance != null) { final TzOffsetTo offset = (TzOffsetTo) observance.getProperty(Property.TZOFFSETTO); if (offset.getOffset().getOffset() < getRawOffset()) { return getRawOffset(); } else { return (int) offset.getOffset().getOffset(); } } return 0; }