Weird behavior or V17 with dates

Hi everyone,

Now i ask to you about a weird behavior in a client/server environment, we have a process that catches some info with date and time, this date is stored like “2020-04-04T00:00:00Z”, and from this point everything seems normal, when other process gets this information to send a message, in one particular computer, this date is shown like 04/04/2020 (in date format) but all the other machines show this as “!!2020-04-04!!”, i didn’t found any clue about why this machine can process dates normally, and others don’t, pleas, if you know something about this weird behavior, and how i can solve this for the rest of the computers, i’ll appreciate too mucho your help

Thanks

JORGE SANCHEZ

I think it would help if you could specify where the values are displayed.

Is it the method editor, or the debugger?

Thank you for your answer.

Well, i’ll try to explaim myself better, i have a process that reads some information from another 4D application, this information is read like this:

{
“unidad”: “11-00-9607”,
“codigo”: “E602000”,
“fecha”: “2020-04-27T00:00:00.000Z”,
“hora”: “07:20:50”,
“recetpora”: “49”,
“msg”: “PTS”,
“descripcion”: “TEST DE SEÑAL-Usu: Uno”,
“segmento”: “X”
}

The field “fecha” seems good, but when i start the process to analyze this info, and the system concatenate it in a text, it becomes like this:

as you see, i use JSON parse to convert this string to an object, but it still shows dates like this, this behavior only happens on some mechines, but i just have one that works properly, i check this machine about regional configuration, all 4D parameters and all that i have in my mind to solve this, but i don’t know how to solve this, even i check versions of both clients and there are the same

Thanks for your help

Jorge Sanchez

It seems it has something to with the database parameter "Dates inside objects"

An example from this topic OB Get(…,Is date) ungleich Date(OB Get(…)) (unfortunately in German and only accessible as a partner)

SET DATABASE PARAMETER(Dates inside objects;string type with time zone)

$prop:=JSON Parse($jsonin)
$varname:=“value”
$date1:=OB Get($prop;$varname;Is date)
$date2:=Date(OB Get($prop;$varname))

SET DATABASE PARAMETER(Dates inside objects;date type)

As you can see, you can switch between the different modes. But in your situation you get the JSON data from another 4D application I think you have more control to format the output JSON data in a proper way.
Please refer the docs of SET DATABASE PARAMETER too.

Hi there, thanks for your answer.

I’ve already read about this parameter, but is curious how this works just in one computer without any change, all computers were configured the same, I’ll try to change this parameter to see if the result changes or if something remains the same

I’ll tell you later what happen with this, thanks for your suggestions

Regards

Jorge Sanchez

Hello, according to the documentation, the scope is the current process, not even the current machine. But it does seem like a mystery, if you haven’t used the selector at all.