code: public static long getUTCMilliseconds(@NonNull final String dateStr) {
  
          if (!TextUtils.isEmpty(dateStr)) {
  
              DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH);
              sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
              Date date = null;
              try {
                  date = sdf.parse(dateStr);
              } catch (ParseException e) {
                  e.printStackTrace();
              }
  
              if (date != null) {
                  return date.getTime();
              }
          }
  
          return -1;
      }
docs: Gets the UTC time in milliseconds from 'yyyy-MM-dd'T'HH:mm:ss.SSS'Z'' formatted date string.
  
  @param dateStr 'yyyy-MM-dd'T'HH:mm:ss.SSSz' formatted date string.
  @return UTC time in milliseconds.