Home>

I work using CamundaBPM, collect statistics on tasks and more, execute a request for my own endpoint (on RestController) and get a list of processes and their tasks

@GetMapping ("/history")
public ResponseEntity <
List <
ProcessDto >
>
 getHistoryProcesses (HttpServletRequest request, HttpServletResponse response) {
    ...
}

Class:

public class ProcessDto {
private String id;
private Date created;
...
}

The time zone is Europe /Moscow, the date (if you look through the debugger) is correct and looks like this:

created: Mon Nov 01 14:16:40 MSK 2021-the Date type, if expanded, then

fastTime: 1635765400581
cdate: 2021-11-01T14: 16: 40.581 + 0300

The debug console displays the correct time:DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor -Writing [[ProcessDto (id= 2fe11c6f-3b05-11ec-978e-0242ac110003, created= Mon Nov 01 14:16:40 MSK 2021, ownerName (truncated) ...

But the problem is that the response time is displayed (in the browser, in the postman) 3 hours less than it should be."created": "2021-11-01T11: 16: 40.581 + 0000",and already looks like this

I'm guessing there is a problem in serializing (?) dates of this type, do you need to change the Jackson config or something?

the browser displays the time in utc. He writes to you that the time zone is +0000

ArchDemon2021-12-02 09:09:09

@ArchDemon I understand that this time is in UTC, but why is it? Why is the time zone not taken into account? For example, a person in the UTc+ 6 time zone will display an incorrect date, this should not be the case. Or am I wrong and think about the wrong thing?

Revasha2021-12-02 09:09:09