I need to update jira custom field through API.
"customfield_10003": "2011-10-19T10:29:29.908+1100"
According to jira This format is ISO 8601: YYYY-MM-DDThh:mm:ss.sTZD
I need to create the same date format with PHP. Please help me to do so.
I need to update jira custom field through API.
"customfield_10003": "2011-10-19T10:29:29.908+1100"
According to jira This format is ISO 8601: YYYY-MM-DDThh:mm:ss.sTZD
I need to create the same date format with PHP. Please help me to do so.
Use date with the c format.
http://php.net/manual/en/function.date.php
ISO 8601 date 2004-02-12T15:19:21+00:00
<?php
echo date("c");
To convert a specific date, you use DateTime or strtotime and date.
Try this:
<?php
$strDateAndTime = '2016-09-29 14:15:50';
$objDateTime = new DateTime($strDateAndTime);
$iso8601Date = $objDateTime->format(DateTime::ATOM);
var_dump($iso8601Date); //<== string '2016-09-29T14:15:50+02:00' (length=25)