我创建了一个Web Service,返回一个元素的数组:
<Service>
<id>string</id>
<description>string</description>
<last_change_date>dateTime</last_change_date>
</Service>
我使用Ksoap2包从android设备中使用这个Web Service。当我使用下面的方法从Web Service中接收SoapObject时:
SoapObject response = (SoapObject)envelope.getResponse();
通常能用下面的代码获得response的内容
String str = (String)response.getProperty(index).toString();
这是能正常运行的。
但是,为了获得上次修改的时间(在SQL Server的数据库中从 datetime 字段中检索 dateTime类型),我就不能使用相同的方法。
所以,我现在在找一个方法在任何的日期格式 (Date 或 Calendar) 中转换dateTime,请问如何实现?