使用表达式将XMl代码转换为java代码

时间:2011-03-24 07:34:28

标签: java xml-binding

<date-time>2008-07-13T18:00:00</date-time>

1 个答案:

答案 0 :(得分:0)

也许你正在寻找这样的东西:

String pattern = "'<date-time>'yyyy-MM-dd'T'HH:mm:ss'</date-time>'";
SimpleDateFormat format = new SimpleDateFormat(pattern);
Date date = format.parse("<date-time>2008-07-13T18:00:00</date-time>");