Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to retrieve the correct DueDate?

Matthias Kuespert January 12, 2013

Hi,

when I specify a DueDate on issue creation, e.g. 12.01.2013, the value stored in the database is 11.01.2013.

However, when I view the issue the DueDate field has the correct value (12.01.2013) and in the search results the wrong one (11.01.2013).
Also the wrong value (1 day before) is returned when retrieving the DueDate in a plugin via this code:

Calendar dueDate = Calendar.getInstance();
dueDate.setTimeInMillis(issue.getDueDate().getTime());

What is the reason for this behaviour? How should the correct DueDate be retrieved?

Environment:
- SLES 10
- JIRA-4.4.4 / Java 1.6
- Oracle 11.3.0.2 on a separate, externally maintained system

Cheers,
Matthias

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
vkharisma
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 15, 2013

Matthias,

It seems that you ran into known bug in JIRA: https://jira.atlassian.com/browse/JRA-26962 and https://jira.atlassian.com/browse/JRA-26160

Fortunately, the bug has been fixed in JIRA 5.0.1 and above. I'd suggest you to upgrade your instance to the latest version to avoid this bug. Meanwhile, you can add <tt>-Duser.timezone=GMT+1 </tt>under your JVM startup parameter so the new created issue will have a correct due date in the db.

Cheers, Vicky.

Matthias Kuespert January 20, 2013

Upgrading JIRA is currently not an option.

Setting the timezone explicitely helps: all new created issues now have the same value in the database as shown in the UI.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2013

What's the timezone set for the instance. Does the difference match the timezone difference from GMT?

Matthias Kuespert January 12, 2013

Hi Renjith,

the timezones are:

  • JIRA: MET +0100
  • Oracle: Europe/Berlin

which should match, shouldn't they.

Cheers,

Matthias

BTW: the timezones were retrieved via

  • JIRA: SimpleDateFormat parameter 'Z' in the JIRA plugin
  • ORACLE: select SESSIONTIMEZONE from dual;
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2013
Can you check what is actually stored in database for a sample issue? Table name jiraissue.
Matthias Kuespert January 13, 2013

If I select '12.01.2013' as DueDate in the UI, a 'select DueDate from jiraissue' shows the value '11.01.13'.

Matthias Kuespert January 13, 2013

Yes: the IssueNavigator shows the wrong date (11.01.2013).

BTW: as mentioned above I use JIRA 4.4.4.

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2013

And you also said "and in the search results the wrong one (11.01.2013)" - Is this happening in Issue Navigator?

JIRA 5.2 is acually showing me correct date on PostgreSQL.

TAGS
AUG Leaders

Atlassian Community Events