/** * Sets the value. * @param newValue the value as {@link DateTime#getElapsedSeconds() the elapsed seconds} * @return this * @deprecated Application developer should not use this method directly */ @Deprecated public DateTimeOption modify(long newValue) { this.nullValue = false; this.entity.setElapsedSeconds(newValue); return this; }
/** * Creates a new instance which represents the specified value. * @param valueOrNull the initial value (nullable) */ public DateTimeOption(DateTime valueOrNull) { if (valueOrNull == null) { this.nullValue = true; } else { this.entity.setElapsedSeconds(valueOrNull.getElapsedSeconds()); this.nullValue = false; } }
/** * Sets the value. * @param newValue the value (nullable) * @return this * @deprecated Application developer should not use this method directly */ @Deprecated public DateTimeOption modify(DateTime newValue) { if (newValue == null) { this.nullValue = true; } else { this.nullValue = false; this.entity.setElapsedSeconds(newValue.getElapsedSeconds()); } return this; }
/** * Parses the target string using the specified format, and returns the corresponding date and time object. * @param timeString the target string * @param format the format kind * @return the corresponding date and time object * @throws IllegalArgumentException if the target string is malformed */ public static DateTime valueOf(String timeString, DateTime.Format format) { if (timeString == null) { throw new IllegalArgumentException("timeString must not be null"); //$NON-NLS-1$ } if (format == null) { throw new IllegalArgumentException("format must not be null"); //$NON-NLS-1$ } DateTime time = new DateTime(); time.setElapsedSeconds(format.parse(timeString)); return time; }
private DateTime time(long elapsed) { DateTime date = new DateTime(); date.setElapsedSeconds(elapsed); return date; } }
private DateTime time(int y, int m, int d, int h, int min, int s) { int days = DateUtil.getDayFromDate(y, m, d); int secs = DateUtil.getSecondFromTime(h, min, s); DateTime date = new DateTime(); date.setElapsedSeconds((long) days * 86400 + secs); return date; }
private DateTime time(int y, int m, int d, int h, int min, int s) { int days = DateUtil.getDayFromDate(y, m, d); int secs = DateUtil.getSecondFromTime(h, min, s); DateTime date = new DateTime(); date.setElapsedSeconds((long) days * 86400 + secs); return date; }
time.setElapsedSeconds((long) DateUtil.getDayFromDate(start, 1, 1) * 86400); while (calendar.get(Calendar.YEAR) <= end) { time.setElapsedSeconds(time.getElapsedSeconds() + 65537);