郁闷死了,c#里面从数据库返回XML序列,时间格式都是2006-05-17T00:00:00.0000000+08:00 这样的格式
加载到客户端就都是这样的格式,然后所有用到时间的地方都要进行javascript时间转换
相当的烦琐,不让在修改保存时候就会出错,然后显示在客户端也相当的不爽
能不能在返回XML序列之初就把时间格式化为: 2006-05-12 19:30:20 的格式啊
以前都没有这样的问题的
下面是返回XML的代码
If ImyDBTYPE = -1 Then
Return Nothing
End If
Dim myReader As System.Xml.XmlReader
Dim myCmd As New SqlClient.SqlCommand
myCmd.CommandTimeout = 500
myCmd.CommandText = strSQL
myCmd.Connection = SQL_myCON
Try
myReader = myCmd.ExecuteXmlReader()
If (myReader Is Nothing) Then
Return Nothing
End If
Return myReader
Catch ex As Exception
''此处应考虑写入日志
Return Nothing
Finally
myCmd.Dispose()
End Try