/** * Applies the specified timezone to all dates in the list. * All dates added to this list will also have this timezone * applied. * @param timeZone a timezone to apply to contained dates */ public final void setTimeZone(final TimeZone timeZone) { if (!Value.DATE.equals(type)) { for (Date date: this) { ((DateTime) date).setTimeZone(timeZone); } } this.timeZone = timeZone; this.utc = false; }
/** * Applies the specified timezone to all dates in the list. * All dates added to this list will also have this timezone * applied. * @param timeZone a timezone to apply to contained dates */ public final void setTimeZone(final TimeZone timeZone) { if (!Value.DATE.equals(type)) { for (Date date: this) { ((DateTime) date).setTimeZone(timeZone); } } this.timeZone = timeZone; this.utc = false; }
/** * Applies the specified timezone to all dates in the list. * All dates added to this list will also have this timezone * applied. * @param timeZone a timezone to apply to contained dates */ public final void setTimeZone(final TimeZone timeZone) { if (!Value.DATE.equals(type)) { for (Date date: this) { ((DateTime) date).setTimeZone(timeZone); } } this.timeZone = timeZone; this.utc = false; }
/** * Applies the specified timezone to all dates in the list. * All dates added to this list will also have this timezone * applied. * @param timeZone a timezone to apply to contained dates */ public final void setTimeZone(final TimeZone timeZone) { if (!Value.DATE.equals(type)) { for (Date date: this) { ((DateTime) date).setTimeZone(timeZone); } } this.timeZone = timeZone; this.utc = false; }
/** * Applies the specified timezone to all dates in the list. * All dates added to this list will also have this timezone * applied. * @param timeZone a timezone to apply to contained dates */ public final void setTimeZone(final TimeZone timeZone) { if (!Value.DATE.equals(type)) { for (final Iterator i = iterator(); i.hasNext();) { ((DateTime) i.next()).setTimeZone(timeZone); } } this.timeZone = timeZone; this.utc = false; }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * Updates the start and (possible) end times of this period to reflect * the specified timezone status. * @param timezone a timezone for the period */ public final void setTimeZone(final TimeZone timezone) { getStart().setUtc(false); getStart().setTimeZone(timezone); getEnd().setUtc(false); getEnd().setTimeZone(timezone); }
/** * @param date * a date-time value */ public DateTime(final java.util.Date date) { super(date.getTime(), Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(date.getTime(), getFormat().getTimeZone()); // copy timezone information if applicable.. if (date instanceof DateTime) { final DateTime dateTime = (DateTime) date; if (dateTime.isUtc()) { setUtc(true); } else { setTimeZone(dateTime.getTimeZone()); } } }
/** * @param date * a date-time value */ public DateTime(final java.util.Date date) { super(date.getTime(), Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(date.getTime(), getFormat().getTimeZone()); // copy timezone information if applicable.. if (date instanceof DateTime) { final DateTime dateTime = (DateTime) date; if (dateTime.isUtc()) { setUtc(true); } else { setTimeZone(dateTime.getTimeZone()); } } }
/** * @param date * a date-time value */ public DateTime(final java.util.Date date) { super(date.getTime(), Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(date.getTime(), getFormat().getTimeZone()); // copy timezone information if applicable.. if (date instanceof DateTime) { final DateTime dateTime = (DateTime) date; if (dateTime.isUtc()) { setUtc(true); } else { setTimeZone(dateTime.getTimeZone()); } } }
private void normalise() { // ensure the end timezone is the same as the start.. if (getStart().isUtc()) { getEnd().setUtc(true); } else { getEnd().setTimeZone(getStart().getTimeZone()); } }
private void normalise() { // ensure the end timezone is the same as the start.. if (getStart().isUtc()) { getEnd().setUtc(true); } else { getEnd().setTimeZone(getStart().getTimeZone()); } }
public void testZuluToLocal() throws Exception { DateTime d = new DateTime(zuluDateTimeStr); d.setTimeZone(timezone); assertEquals(expectedLocalDateTimeStr, d.toString()); }
private void normalise() { // ensure the end timezone is the same as the start.. if (getStart().isUtc()) { getEnd().setUtc(true); } else { getEnd().setTimeZone(getStart().getTimeZone()); } }
private void normalise() { // ensure the end timezone is the same as the start.. if (getStart().isUtc()) { getEnd().setUtc(true); } else { getEnd().setTimeZone(getStart().getTimeZone()); } }
private void normalise() { // ensure the end timezone is the same as the start.. if (getStart().isUtc()) { getEnd().setUtc(true); } else { getEnd().setTimeZone(getStart().getTimeZone()); } }
@Override public Property toVEvent(final TeamEventDO event) { if (event.isAllDay() == true) { final Date startUtc = CalendarUtils.getUTCMidnightDate(event.getStartDate()); net.fortuna.ical4j.model.Date date = new net.fortuna.ical4j.model.Date(startUtc); return new DtStart(date); } else { DateTime date = new DateTime(event.getStartDate()); date.setTimeZone(TIMEZONE_REGISTRY.getTimeZone(event.getTimeZone().getID())); return new DtStart(date); } }