cancel
Showing results for 
Search instead for 
Did you mean: 

GET task rest call ignoring timezone

penusila611621
Champ in-the-making
Champ in-the-making

Hi,

I am working in GMT+5:30 timezone. Task are created in the oracle database with the due date considering GMT+5:30. But when I run the following rest to fetch the task list, task due date GMT is ignored.

http://localhost:8080/activiti-rest/service/runtime/tasks/59431

Response for the above rest
"dueDate": "2014-09-08T13:02:22.554+0000"

Here the due date must be returned as

"dueDate": "2014-09-08T18:32:22.554+0000"

I think somewhere Activiti Rest frame work ignoring the time zone.
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

What's the due date in the database in your example?

Best regards,

penusila611621
Champ in-the-making
Champ in-the-making
Hi Tijs,

Have created fresh task this morning & due date details are as below.

due date captured in database for the task: 09-SEP-14 10.20.42.990000000 AM
due date the following rest returning for the same task: 2014-09-09T04:50:42.990+0000

GET http://localhost:8080/activiti-rest/service/runtime/tasks/61905

Again reiterating that I am working in GMT+5:30 timezone & the timezone was set properly in my system.

trademak
Star Contributor
Star Contributor
The returned date from the REST API is correct because it has a timezone of GMT.
So the date in your database is changed to DATE - 5.30.
If you want to display the date in your timezone you can transform the date to use GMT+5:30 again.

Best regards,

penusila611621
Champ in-the-making
Champ in-the-making
Hi Tijs

I did't understand what do you mean y "So the date in your database is changed to DATE - 5.3". As I posted above, database is persisting the date correctly.  How to change the REST api so that it can consider GMT+5:30. What do you mean by transforming the date to use GMT+5:30.

Many thanks for your help here.

penusila611621
Champ in-the-making
Champ in-the-making
I do not want to programatically transform the date returned by REST to GMT+5:30. Is there a way to make REST to consider GMT+5:30

suseno
Champ on-the-rise
Champ on-the-rise
Hi,
I am facing the same issue here when using REST.
ACTIVITI REST ignoring Time zone that i have set in the server

i hope the REST engine can read server's Time Zone

penusila611621
Champ in-the-making
Champ in-the-making
Here is the solution to this problem.

Extend the ActivitiRestServicesApplication & override the method createInboundRoot.

Add the following lines at the end of his method.

          DateFormat format=new SimpleDateFormat("your date format");
          jacksonConverter.getObjectMapper().setDateFormat(format);