I want to have a date-time string in the "yyyy-MM-dd'T'HH:mm:ss.SSSZ" format. I wrote the following code snippet:
    Date date=Calendar.getInstance().getTime();
    String currentDateTimeString = (String) android.text.format.DateFormat.
           format("yyyy-MM-dd'T'HH:mm:ss.SSSZ",Calendar.getInstance().getTime());
but I get strings like
"2019-11-08T13:39:33.SSSZ"
also when the format is "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" (with 'Z' escaped).
Patterns are found at https://developer.android.com/reference/java/text/SimpleDateFormat.html#examples
Why milliseconds do not appear?