I'm connecting my django website to an android app using json and the rest framework
The json data contains datetime like this :
{
date: "2018-06-05T12:42:48.545140Z"
}
When android receives the date, I try to format it using this code :
String dt="2018-06-05T12:42:48.545140Z";
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm");
String date=formatter.format(Date.parse(dt));
And I get the following error :
java.lang.IllegalArgumentException:
Parse error: 2018-06-14T14:30:02.982009Z
at java.util.Date.parseError(Date.java:367)
at java.util.Date.parse(Date.java:448)
In a django a template I can easily do this
{{article.date|date:'d-m-Y H:i'}}
But in android I'm a bit confused