Welcome, Guest
Guest Settings
Help

Thread: TJson.ObjectToJsonString


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Apr 19, 2017 7:13 AM Last Post By: Eric ten Westen... Threads: [ Previous | Next ]
Eric ten Westen...

Posts: 75
Registered: 12/8/99
TJson.ObjectToJsonString  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 12, 2017 1:05 AM
Hi

I'm testing TJson.ObjectToJsonString

I have a class with a TDateTime

Call the method twice:

First time:

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo, [joDateFormatISO8601]);


Second time

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo);

The output in the memo is the same, i did not expect this , second time default parameters are used : AOptions: TJsonOptions = [joDateIsUTC, joDateFormatISO8601]

So i expected , one of them, to show the date string using +001 as that is my time zone

Eric

Edited by: Eric ten Westenend on Apr 12, 2017 6:07 AM

Remy Lebeau (Te...


Posts: 7,926
Registered: 12/23/01
Re: TJson.ObjectToJsonString [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 13, 2017 12:11 PM   in response to: Eric ten Westen... in response to: Eric ten Westen...
Eric wrote:

Call the method twice:

First time:

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo, [joDateFormatISO8601]);


Second time

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo);


The output in the memo is the same, i did not expect this

What is the result you are actually getting both times?

--
Remy Lebeau (TeamB)


---
This email has been checked for viruses by AVG.
http://www.avg.com

Eric ten Westen...

Posts: 75
Registered: 12/8/99
Re: TJson.ObjectToJsonString [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 7:03 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy

it's 2017-04-18T16:00:00Z

Eric

Remy Lebeau (TeamB) wrote:
Eric wrote:

Call the method twice:

First time:

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo, [joDateFormatISO8601]);


Second time

Memo1.Lines.Text := TJson.ObjectToJsonString(Foo);


The output in the memo is the same, i did not expect this

What is the result you are actually getting both times?

--
Remy Lebeau (TeamB)


---
This email has been checked for viruses by AVG.
http://www.avg.com

Remy Lebeau (Te...


Posts: 7,926
Registered: 12/23/01
Re: TJson.ObjectToJsonString [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 9:31 AM   in response to: Eric ten Westen... in response to: Eric ten Westen...
Eric wrote:

it's 2017-04-18T16:00:00Z

JSON serialization has several bugs in it. Looks like this is yet another
one. Feel free to file a bug report with Embarcadero:

http://quality.embarcadero.com

--
Remy Lebeau (TeamB)
Eric ten Westen...

Posts: 75
Registered: 12/8/99
Re: TJson.ObjectToJsonString [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2017 7:13 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Done!

Remy Lebeau (TeamB) wrote:
Eric wrote:

it's 2017-04-18T16:00:00Z

JSON serialization has several bugs in it. Looks like this is yet another
one. Feel free to file a bug report with Embarcadero:

http://quality.embarcadero.com

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02