示例#1
0
文件: Datebox.java 项目: adrgit/zk
 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));
 }
示例#2
0
文件: Datebox.java 项目: adrgit/zk
  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));
  }