Code example for SimpleDateFormat

Methods: toPattern

    final DateFormat dateFormat = DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale);
    if (dateFormat instanceof SimpleDateFormat)
      this.dateFormat = (SimpleDateFormat) dateFormat;
      this.pattern = this.dateFormat.toPattern();
      // this should not happen in Sun JDKs, but you never know how the implementation looks like .. 
      final ResourceBundle datePatterns = ResourceBundle.getBundle
      final String dateText;
      switch (dateStyle)
        case DateFormat.SHORT:
          dateText = datePatterns.getString("");
Connect your IDE to all the code out there  Get Codota for Java