Greetings.
I have the following code.
DEFINE INPUT PARAMETER dateCashOut AS CHARACTER NO-UNDO. DEFINE OUTPUT PARAMETER jsonText AS LONGCHAR NO-UNDO. DEFINE VARIABLE jsonArray AS Progress.Json.ObjectModel.JsonArray NO-UNDO. EMPTY TEMP-TABLE ttdwCorteDeCaja. FOR EACH dwCorteDeCaja WHERE dwCorteDeCaja.Fecha = DATE(dateCashOut). CREATE ttdwCorteDeCaja. BUFFER-COPY dwCorteDeCaja TO ttdwCorteDeCaja. END. FIND FIRST ttdwCorteDeCaja NO-ERROR. IF AVAILABLE(ttdwCorteDeCaja) THEN DO: jsonArray = NEW Progress.Json.ObjectModel.JsonArray(). jsonArray:Read(TEMP-TABLE ttdwCorteDeCaja:HANDLE). jsonText = jsonArray:GetJsonObject(1):GetJsonText(). END.
And receive the data in no suitable format.
I would like to get date (one of the fields in dwCorteDeCaja) in "dd/mm/yyyy" or "dd-mm-yyyyy" format, the separators are not the problem, Now, json field gets it formatted as "yyyy-mm-yy" when marshalling temp-table.
Is there a way to instruct Progress.Json.ObjectModel.JsonArray to format that date field the other way (dd-mm-yyyy)?
Thanks Peter. Done as you told....
BUT... this brought to my attention something that makes me wonder.
I have never realized before how I defined the date format for use on my system. And now, making test with appserver -> angular, I found that never used the SESSION:DATE-FORMAT nor -d parameters, and yet, all my users found natural the "dmy" format that system used and showed on screen. The only time they were defined was on database creation and client-networking instalation...
So I'm curious, where did AVL takes date format for using on UI at runtime? As it has been allways "correct" .
Is it integrated or defaulted on installation? It's taken from windows localisation?
It's interesting, 20 years later after my first FOR EACH CLIENTE: ...
In your OpenEdge installation folder you will find a startup.pf file which contains default client startup parameters. Date and number formats are a couple of the things that are defined in this file. Parameters in this file are processed every time you start a client so they dont have to be specified each time but can be changed if you specify your own on the command line when starting up a client.