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

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 Leaders.
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 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 May 11, 2015

Can we file a bug about that?

Charles Jamison 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 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

Suggest an answer

Log in or Sign up to answer