On Mon, 18 Jul 2016, Stéphane Wierzbicki wrote:
Hello,
I'm working with the TJSONStreamer and TJSONDeStreamer class. I need to
exchange JSON object with a REST server. Date needs to be formatted this
way : 'yyyy-MM-dd"T"hh:nn:ss"Z"'
Here is what I've done :
Streamer.Options := Streamer.Options + [jsoDateTimeAsString ,
jsoUseFormatString];
Streamer.DateTimeFormat := 'yyyy-MM-dd"T"hh:nn:ss"Z"'; //ISO8601
JSONString := Streamer.ObjectToJSONString(MyObject);
....
DeStreamer.JSONToObject(JSONString , MyObject); <= Exception
I'm getting an exception when converting my string to the object again.
TJSONDeStreamer failed to convert this format back to
'yyyy-MM-dd"T"hh:nn:ss"Z".
I have modified TJSONStreamer and TJSONDeStreamer class to handle ISO8601
dates by adding a new jsoDateTimeAsISO8601 option.
Where can I send these modifications ?
What version of FPC did you use ?
The latest version of TJSONStreamer and TJSONDeStreameruse this format
already, check the jsoLegacyDateTime option.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel