On Fri, 01 Apr 2011, Ron Pinkas wrote:
Hi Ron,
> >JSON format does not support dates and timestamp values.
> >So when you pass date item to be converted to JSON format
> >we have 3 choices:
> >1. generate RTE
> >2. convert date to some other format, accepted by JSON, i.e.
> > "MMDD" strings
Hey Ron,
> We could also consider a 4th choice, I.e. when converting date to string in
> the wrapper add extra flag to the string such that when it is decoded the
> wrapper will again convert the JSON decoded string to a date value. This of
> course means that the string coded by JSON will read so
>> Was thinking.. If we change hb_jsonencode() to also use Date's, will
>> the output than be JSon compatible? I mean, I need to be able to read
>> the JSon string with another language that supports JSon strings.
>> Any thoughts? ;-)
>
> JSON format does not support dates and timestamp values.
> S
On Fri, 1 Apr 2011 14:15:44 +0200
"Patrick Mast, xHarbour." wrote:
> Hey Andi,
>
> > The encoding does accept DATE and TIMEFLAG. Or am I missing something?
>
> Please look at this sample:
>
> JSon:=hb_jsonencode(Date(), .F.)
> ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a da
Hey Andi,
> The encoding does accept DATE and TIMEFLAG. Or am I missing something?
Please look at this sample:
JSon:=hb_jsonencode(Date(), .F.)
? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var
So, it seems it does not recognize the Date value when decoding.
;-)
Patric
On Fri, 01 Apr 2011, Patrick Mast, xHarbour.com Inc. wrote:
Hi Patrick,
> Was thinking.. If we change hb_jsonencode() to also use Date's, will
> the output than be JSon compatible? I mean, I need to be able to read
> the JSon string with another language that supports JSon strings.
> Any thoughts
Hi,
The encoding does accept DATE and TIMEFLAG. Or am I missing something?
Andi
On Fri, 1 Apr 2011 13:56:38 +0200
"Patrick Mast, xHarbour." wrote:
> Hello,
>
> Was thinking.. If we change hb_jsonencode() to also use Date's, will
> the output than be JSon compatible? I mean, I need to be able
Hello,
Was thinking.. If we change hb_jsonencode() to also use Date's, will
the output than be JSon compatible? I mean, I need to be able to read
the JSon string with another language that supports JSon strings.
Any thoughts? ;-)
Thanks!
Patrick
On Fri, Apr 1, 2011 at 1:49 PM, Andi Jahja wrot
On Fri, 1 Apr 2011 09:03:52 +0200
"Patrick Mast, xHarbour." wrote:
> Hello Mindaugas,
>
> >> JSon:=hb_jsonencode(Date(), .F.)
> >> ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var
> >
> > JSON encoding does not have date type, so, I've implemented date to
> > character
Hello Mindaugas,
>> JSon:=hb_jsonencode(Date(), .F.)
>> ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var
>
> JSON encoding does not have date type, so, I've implemented date to
> character string mapping in hb_jsonEncode() in Harbour. If xHarbour's
> JSON implementation is
10 matches
Mail list logo