Convert Java Date into XML Date Format (and vice versa)

后端 未结 9 1615
后悔当初
后悔当初 2020-12-03 10:46

Is there a nice and easy way to convert a Java Date into XML date string format and vice versa?

Cheers,

Andez

9条回答
  •  天命终不由人
    2020-12-03 11:19

    Just by using SimpleDateFormat in java we can do this...

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
    Date date = sdf.parse("2011-12-31T15:05:50+1000");
    

提交回复
热议问题