You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Michael Vorburger (Jira)" <ji...@apache.org> on 2020/05/08 21:30:00 UTC

[jira] [Resolved] (FINERACT-926) java.util.Date returned in ISO-8601 instant format ("2011-12-03T10:15:30Z") instead of as "May 3, 2020 10:51:19 PM"

     [ https://issues.apache.org/jira/browse/FINERACT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Vorburger resolved FINERACT-926.
----------------------------------------
    Resolution: Fixed

> java.util.Date returned in ISO-8601 instant format ("2011-12-03T10:15:30Z") instead of as "May 3, 2020 10:51:19 PM"
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: FINERACT-926
>                 URL: https://issues.apache.org/jira/browse/FINERACT-926
>             Project: Apache Fineract
>          Issue Type: Improvement
>            Reporter: Michael Vorburger
>            Assignee: Michael Vorburger
>            Priority: Major
>             Fix For: 1.4.0
>
>
> Fineract, in [its apiLive.htm|https://github.com/search?q=repo%3Aapache%2Ffineract+filename%3AapiLive.htm&type=Code] doc (also e.g. [here|https://demo.mifos.io/api-docs/]), specifies that, quote: 
> {quote}Dates are returned in GET requests as an array e.g. [ 2007, 4, 11]. However, the API accepts them as strings in POST and PUT requests. (...){quote}
> This appears to be the case for {{org.joda.time.LocalDate}} instances (see {{org.apache.fineract.infrastructure.core.api.JodaLocalDateAdapter}}), and {{org.joda.time.DateTime}} are turned into nubmers of miliseconds in JSON returned by the API, and {{org.joda.time.MonthDay}} into an array of monthOfYear and dayOfMonth.
> For any {{java.util.Date}} instances, the situation appears to be less clear. While working on FINERACT-922 and wanting to interpret e.g. a {{jobRunStartTime}} or {{jobRunEndTime}}, which are {{java.util.Date}} instances in {{JobDetailHistoryData}}, I've noticed that they are currently returned as e.g. "May 3, 2020 10:51:19 PM". This format misses the timezone, and doesn't seem to be documented nor fixed in the code anywhere - it's some default by GSON? Possibly _Locale_ dependant? Those are always fun.
> For better reproducibility, I propose that we we fix the format of such fields. Unless we need to stay backwards compatible (do we?), the "convention" in JSON seems to be to use the ISO-8601 format. I think it's the "instant format", e.g. 2011-12-03T10:15:30Z (normed to GMT), but I'm not 100% sure.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)