GET task rest call ignoring timezone

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2014 03:13 AM
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.
Labels:
- Labels:
-
Archive
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2014 02:21 PM
Hi,
What's the due date in the database in your example?
Best regards,
What's the due date in the database in your example?
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 12:55 AM
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.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2014 09:46 AM
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,
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,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2014 12:31 AM
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.
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.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2014 01:37 AM
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2014 10:20 PM
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
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2014 12:30 AM
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);
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);
