View | Details | Raw Unified | Return to bug 48924
Collapse All | Expand All

(-)DateAndTime.java (+8 lines)
Lines 17-22 Link Here
17
17
18
package org.apache.poi.hwpf.usermodel;
18
package org.apache.poi.hwpf.usermodel;
19
19
20
import java.util.Calendar;
21
20
import org.apache.poi.util.BitField;
22
import org.apache.poi.util.BitField;
21
import org.apache.poi.util.BitFieldFactory;
23
import org.apache.poi.util.BitFieldFactory;
22
import org.apache.poi.util.LittleEndian;
24
import org.apache.poi.util.LittleEndian;
Lines 49-54 Link Here
49
    _info2 = LittleEndian.getShort(buf, offset + LittleEndian.SHORT_SIZE);
51
    _info2 = LittleEndian.getShort(buf, offset + LittleEndian.SHORT_SIZE);
50
  }
52
  }
51
53
54
  public Calendar getDate() {
55
	  Calendar cal = Calendar.getInstance();
56
	  cal.set(_years.getValue(_info2)+1900, _months.getValue(_info2)-1, _dom.getValue(_info), _hours.getValue(_info), _minutes.getValue(_info));
57
	  return cal;
58
  }
59
  
52
  public void serialize(byte[] buf, int offset)
60
  public void serialize(byte[] buf, int offset)
53
  {
61
  {
54
    LittleEndian.putShort(buf, offset, _info);
62
    LittleEndian.putShort(buf, offset, _info);

Return to bug 48924