my server has to works with date-time values in the UTC format.
However, when the date-time value is being serialized the DateTimeToSOAPDateTime method formats its string as:
yyyy-mm-ddThh:nn:ss (e.g. 2018-04-19T10:00:00)
Such string is treated by the client JavaScript code as a local date-time value. It would be taken as UTC in case of “Z” at the end of the string e.g.
'2018-04-19T10:00:00Z’.
Question:
What is a right approach to serialize dates as UTC?
I checked XsDateTime and found out that “xsDateTime” converts to “date-time” in JSON. It means that all API client code generated on the base of the JSON won’t differ XsDateTime and DateTime. It leads to unexpected working of methods XsDateTime.WriteComplex/XsDateTime.ReadComplex.
I see the difference but I don’t see how it works in non-Delphi environment (Angular, JavaScript) where API client code is generated from the API JSON?