Integer id; DateTime time; String value; public Log(Integer id, Timestamp time, String value) { this.id = id; this.time = new DateTime(time.getTime()); this.value = value; }
DateTimeZone tz = DateTimeZone.forID("America/Winnipeg"); DateTime dt = new DateTime(tz); DateFormat df = DateFormat.getDateInstance(); df.format(dt.getTime());
/** * Calculates a default end date relative to specified start date. * * @param startDate * @return */ private DateTime getDefaultEndDate(DateTime startDate) { DateTime endDate = new DateTime(startDate.getTime() + TWO_YEARS_MILLIS); endDate.setUtc(true); return endDate; } /**
/** * Default constructor. */ public DateTime() { super(Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); }
/** * Calculates a default end date relative to specified start date. * * @param startDate * @return */ private DateTime getDefaultEndDate(DateTime startDate) { DateTime endDate = new DateTime(startDate.getTime() + TWO_YEARS_MILLIS); endDate.setUtc(true); return endDate; } /**
/** * Default constructor. */ public DateTime() { super(Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); }
/** * Default constructor. */ public DateTime() { super(Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); }
/** * Default constructor. */ public DateTime() { super(Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); }
/** * Default constructor. */ public DateTime() { super(Dates.PRECISION_SECOND, java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); }
/** * @param value a string representation of a date-time * @param pattern a pattern to apply when parsing the date-time value * @param timezone the timezone for the date-time instance * @throws ParseException where the specified string is not a valid date-time */ public DateTime(String value, String pattern, TimeZone timezone) throws ParseException { // this(); super(Dates.PRECISION_SECOND, timezone != null ? timezone : java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); final DateFormat format = CalendarDateFormatFactory.getInstance(pattern); setTime(value, format, timezone); }
private DateTime applyOffsetFrom(DateTime orig) { DateTime withOffset = new DateTime(true); withOffset.setTime(orig.getTime() - getOffsetFrom().getOffset().getOffset()); return withOffset; } }
/** * @param value * a string representation of a date-time * @param pattern * a pattern to apply when parsing the date-time value * @param timezone * the timezone for the date-time instance * @throws ParseException * where the specified string is not a valid date-time */ public DateTime(String value, String pattern, TimeZone timezone) throws ParseException { // setting the time to 0 since we are going to reset it anyway super(0, Dates.PRECISION_SECOND, timezone != null ? timezone : java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); final DateFormat format = CalendarDateFormatFactory .getInstance(pattern); setTime(value, format, timezone); }
/** * @param value * a string representation of a date-time * @param pattern * a pattern to apply when parsing the date-time value * @param timezone * the timezone for the date-time instance * @throws ParseException * where the specified string is not a valid date-time */ public DateTime(String value, String pattern, TimeZone timezone) throws ParseException { // setting the time to 0 since we are going to reset it anyway super(0, Dates.PRECISION_SECOND, timezone != null ? timezone : java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); final DateFormat format = CalendarDateFormatFactory .getInstance(pattern); setTime(value, format, timezone); }
private DateTime applyOffsetFrom(DateTime orig) { DateTime withOffset = new DateTime(true); withOffset.setTime(orig.getTime() - (getOffsetFrom().getOffset().getTotalSeconds() * 1000L)); return withOffset; } }
/** * @param value * a string representation of a date-time * @param pattern * a pattern to apply when parsing the date-time value * @param timezone * the timezone for the date-time instance * @throws ParseException * where the specified string is not a valid date-time */ public DateTime(String value, String pattern, TimeZone timezone) throws ParseException { // setting the time to 0 since we are going to reset it anyway super(0, Dates.PRECISION_SECOND, timezone != null ? timezone : java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); final DateFormat format = CalendarDateFormatFactory .getInstance(pattern); setTime(value, format, timezone); }
/** * @param value * a string representation of a date-time * @param pattern * a pattern to apply when parsing the date-time value * @param timezone * the timezone for the date-time instance * @throws ParseException * where the specified string is not a valid date-time */ public DateTime(String value, String pattern, TimeZone timezone) throws ParseException { // setting the time to 0 since we are going to reset it anyway super(0, Dates.PRECISION_SECOND, timezone != null ? timezone : java.util.TimeZone.getDefault()); this.time = new Time(getTime(), getFormat().getTimeZone()); final DateFormat format = CalendarDateFormatFactory .getInstance(pattern); setTime(value, format, timezone); }
private DateTime applyOffsetFrom(DateTime orig) { DateTime withOffset = new DateTime(true); withOffset.setTime(orig.getTime() - (getOffsetFrom().getOffset().getTotalSeconds() * 1000L)); return withOffset; } }
private DateTime applyOffsetFrom(DateTime orig) { DateTime withOffset = new DateTime(true); withOffset.setTime(orig.getTime() - getOffsetFrom().getOffset().getOffset()); return withOffset; } }
private DateTime applyOffsetFrom(DateTime orig) { DateTime withOffset = new DateTime(true); withOffset.setTime(orig.getTime() - getOffsetFrom().getOffset().getOffset()); return withOffset; } }
this.time = new Time(getTime(), getFormat().getTimeZone());