title: YYYY date format returns 2021 on one device and 2020 on other device
body: <p>I am trying to format the date using the below code.</p>
  <p><strong>2021-01-02 returns JANUARY 2020 in one device and JANUARY 2021 on another device. Why is it so?</strong></p>
  <pre><code>formatDate(transactionItem.dateLabel, &quot;yyyy-MM-dd&quot;, &quot;MMMM YYYY&quot;)?.toUpperCase()
  
  
  public static String formatDate(String inputDate, String inputFormat, String outputFormat) {
          try {
              Locale appLocale = new Locale(LocaleHelper.getDefaultLanguage());
              DateFormat originalFormat = new SimpleDateFormat(inputFormat, appLocale);
              DateFormat targetFormat = new SimpleDateFormat(outputFormat);
              Date dateObject = originalFormat.parse(inputDate);
              String formattedDate = targetFormat.format(dateObject);
              return formattedDate;
          } catch (ParseException var9) {
              return &quot;&quot;;
          } catch (Exception var10) {
              return &quot;&quot;;
          }
      }
  </code></pre>