onryldz / x-superobject

Delphi Cross Platform Rapid JSON
316 stars 118 forks source link

How to control date output in JSON string #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I am really happy that it is now possible to read ISO 8601 Zulu time from a 
JSON string! :).
But how to control the output to JSON?
How to deal with timezones? How to specify that in the JSON output string I 
want Zulu time?

Example:

  json := '{someDate: "2014-03-30T11:15:02Z"}';
  obj := TMyObject.FromJSON(json);
  json := obj.AsJSON();

Now 'someDate' equals to '2014-03-30T13:15:02.000'.
Timezone information is lost, the API I talk to wants Zulu time allways.

What version of the product are you using? On what operating system?
XE3. Newest version of x-superobject at this date.

Please provide any additional information below.
Somehow I hope it will be possible to configure how the TDateTime gets 
serialized to a JSON string.

Original issue reported on code.google.com by Rein.Ver...@gmail.com on 18 Aug 2014 at 8:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r75.

Original comment by onryld...@gmail.com on 15 Sep 2014 at 10:51