这里要用到oracle的包wsclient.jar
import java.util.Calendar;
import oracle.j2ee.ws.common.encoding.simpletype.XSDDateTimeCalendarEncoder;
public class GetXsddateTime {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Calendar cd = (Calendar)XSDDateTimeCalendarEncoder.getInstance()
.stringToObject("2008-01-01T00:00:00+08:00", null);
///do some thing
}
}
本文介绍了一个Java程序示例,该程序使用Oracle提供的XSDDateTimeCalendarEncoder类将字符串形式的日期时间转换为Calendar对象。此方法对于处理XML Schema定义的日期时间格式特别有用。
2万+

被折叠的 条评论
为什么被折叠?



