title: Android SimpleDateFormat.format giving wrong digit amount, like Minute "0040" randomly
body: <p>I have an app for android that has a customized log format that I prefix with the Date for better searching.
  Currently I'm using SimpleDateFormat but the results are inconsistent.</p>
  
  <p>A few examples of this inconsistency, it is giving me:</p>
  
  <pre><code>2018/10/11 10:40:21.229 ____Verbose:
  2018/0010/0011 0010:40:21.230 ____Verbose:
  2018/10/11 10:40:21.232 ____Verbose:
  ...
  2018/10/11 10:40:42.784 ____Verbose:
  2018/10/11 010:040:042.786 ____Verbose:
  2018/10/11 10:40:42.786 ____Verbose:
  </code></pre>
  
  <p>The code I'm using is:</p>
  
  <pre><code>private static final DateFormat LOGDATEFULL = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS");
  private static String strErrorLevel(int errorLevel){
      if (errorLevel == VERBOSE  ) return " ____ VERBOSE: ";
      if (errorLevel == DEBUG    ) return " ____ DEBUG  : ";
      if (errorLevel == INFO     ) return " _.._ INFO   : ";
      if (errorLevel == WARN     ) return " _--_ WARN   : ";
      if (errorLevel == ERROR    ) return " _!!_ ERROR  : ";
      if (errorLevel == ANALYTICS) return " _++_ ANALYTC: ";
      return                              " _**_ ASSERT : ";
  }
  public static void customLog(String message, int level){
      Date currDate = Calendar.getInstance().getTime();
      Log.d(LOGDATEFULL.format(currDate) + " " + strErrorLevel(level) + message);
  }
  </code></pre>
  
  <p>My system Locale is Portuguese Brazilian (pt-BR), and this occurs both when called from the main thread and calling from other threads.</p>
  
  <p>Is there any other solution besides creating a function to manually make the string?</p>
  
  <p>By the way, it occurs even in generating names for files like 'Output_2018-010-11.txt.</p>
  
  <p><strong>Answer:</strong> It was really what <a href="https://stackoverflow.com/a/52766100/10490162">Tom G</a> and <a href="https://stackoverflow.com/a/52765850/10490162">lelloman</a> pointed, in all the places that I used SimpleDateFormat, this one was the only that I had, which might be accessed by more than one thread at a time. I chose Tom G answer for the practicality of implementing in the existing code.</p>
  
  <p>Thanks</p>