The problem is that the TIME part is false when retrieved from a lotusscript:
function ApointmentSet (StartTime as XSD_DATETIME, End Time as XSD_DATETIME) as Long
Dim dts As NotesDateTime
AppointmentSet = Err
Set dts = StartTime.GetValueAsNotesDateTime()
Msgbox "XML TSD/OT " & dts.LSLocalTime
The returned date is 12/18/2006 1:01:03 AM
The date is correct
The TIME is NOT correct
To be sure, I have already tried using a timezone or not, and fractional seconds, etc… Fuzzy behaviour. Also tried to return an XSD_DATETIME from server, to use the very same format as input (acutally, I even did a copy/paste of the reply > wrong result)
Subject: Domino 7 XML: Date problem XSD_DATETIME not correctly converted
I have the same problem.
From what I see in de lsxsd.lss file . . . there’s a bug in the XSD_DATETIME class. The call . . .
Right$(ME.getValueAsString, 12)
. . . should be . . .
Right$(ME.getValueAsString, 8)
Mmm, correct the lsxsd.lss file, re-compile and save your web service … and I think you’re done.
PUBLIC CLASS XSD_DATETIME AS XSD_SIMPLETYPE
SUB SetValueFromNotesDateTime (value As NotesDateTime)
Dim xdtc As New XSD_DATATYPE_CONVERTER
CALL ME.setValueFromString (xdtc.getXSDDate (value) & "T" & xdtc.getXSDTime (value))
End SUB
Function GetValueAsNotesDateTime ( ) As NotesDateTime
Dim xdtc As New XSD_DATATYPE_CONVERTER
Dim ndt As New NotesDateTime ("")
Call xdtc.setXSDDate (ndt, ME.getValueAsString)
if Mid$(ME.getValueAsString,11,1) = "T" then ' if there's a time part after the required CCYY-MM-DD
Call xdtc.setXSDTime (ndt, Right$(ME.getValueAsString, 8))
End If
set GetValueAsNotesDateTime = ndt
End FUNCTION
Subject: RE: Domino 7 XML: Date problem XSD_DATETIME not correctly converted
One more correction in the lsxsd.lss file, in the XSD_DATATYPE_CONVERTER.setXSDDate method.
’ Set the date part of a NotesDateTime From “CCYY-MM-DD …”
Sub setXSDDate (ndt As NotesDateTime, xsddate As String)
If Not ndt.IsValidDate Then ndt.LocalTime = ""
Dim timeonly As String
timeonly = ndt.TimeOnly ' preserve the time part
Dim newDt as New NotesDateTime( Mid$(xsddate,9,2) & "-" & Mid$(xsddate,6,2) & "-" & Left$(xsddate,4) & " " & timeonly )
set ndt = newDt