1234567891011121314151617181920212223 |
- package com.jtgh.yjpt.webService;
- import java.sql.Timestamp;
- import java.util.Date;
- import javax.xml.bind.annotation.adapters.XmlAdapter;
- /**
- * 时间转换判断类
- *
- * @author 袁晓冬
- *
- */
- public class TimestampAdapter extends XmlAdapter<Date, Timestamp> {
- public Date marshal(Timestamp t) {
- return new Date(t.getTime());
- }
- public Timestamp unmarshal(Date d) {
- return new Timestamp(d.getTime());
- }
- }
|