The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

update jira rest api datetime value

lasith gunawardana
June 13, 2013

im using jira rest api to create/edit issues. when updating datetime type fields its giving an error somthing like

"Error parsing time: 2013-06-17T00:00:00+0000"

datetime required ISO8601 format, so i'm using it, but keep getting this error

how can i do this? plz help

thanks in advance

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
dleng
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 Champions.
June 13, 2013

The format for ISO 8601:
YYYY-MM-DDThh:mm:ss.sTZD
Try using 2013-06-17T00:00:00.0+0000
instead of
2013-06-17T00:00:00+0000


sauce:
https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue#JIRARESTAPIExample-CreateIssue-Examplesofcreatinganissue

Michael Osipov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 11, 2015

I have to object, the date format is *not* ISO 8601. The timezone offset is incorrect. The date time is in extended format but the tz offset is not. Thus, the value is illegal.

Michael Osipov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 11, 2015

Can we file a bug about that?

Charles Jamison
Contributor
November 25, 2019

Hi, I just stumbled across this but I think what is happening is that you are returning a date field and so all the other values for hours seconds AND the time zone offset are all zero.  If you need the time zone offset to be correct, you need to change the custom field type (or field type) to be one that has date and time as opposed to just date.

0 votes
Mahmoud Ibrahim
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2020
For Python Developers:

import
datetime datetime.datetime.now().astimezone().replace(microsecond=0).isoformat() >>> 2020-03-20T14:31:43+13:00
0 votes
Dobrivoje Prtenjak
April 13, 2020

static final String JIRA_MISTERY_DATE_FORMAT = "yyyy-MM-dd hh:mm a";

0 votes
lasith gunawardana
June 13, 2013

i tried this format, but problem persists, im using php thanx for the help

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events