吕展辉

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1、普通字符串(日期形式)转换为XMLGregorianCalendar

   SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd");
        Date date2=simpleDateFormat.parse("2013-06-22");
        GregorianCalendar gcal =new GregorianCalendar();
        gcal.setTime(date2);
        XMLGregorianCalendar xgcal= DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal);

posted on 2014-05-06 11:08  吕展辉  阅读(221)  评论(0编辑  收藏  举报