Esempio n. 1
0
 protected Object marshall(Object value) {
   if (value == null || _tzone == null) return value;
   Date date = (Date) value;
   return new Date(
       (date).getTime()
           - Dates.getTimezoneOffset(TimeZones.getCurrent(), date)
           + Dates.getTimezoneOffset(_tzone, date));
 }
Esempio n. 2
0
  protected Object unmarshall(Object value) {
    if (value == null || _tzone == null) return value;

    if (!(value instanceof Date)) {
      throw new WrongValueException(this, MZul.NUMBER_REQUIRED, value);
    }

    Date date = (Date) value;
    return new Date(
        (date).getTime()
            + Dates.getTimezoneOffset(TimeZones.getCurrent(), date)
            - Dates.getTimezoneOffset(_tzone, date));
  }