Package java.text

Examples of java.text.SimpleDateFormat.applyPattern()


      switch (format.charAt(++ix)) {
          case '%': // Insert a %.
        result.append('%');
        break;
          case 'a': // Abbreviated weekday name (Mon, Tue, etc.).
        fmt.applyPattern("EEE");
        fmt.format(date, result, fp);
        break;
          case 'A': // Full weekday name (Monday, Tuesday, etc.).
        fmt.applyPattern("EEEE");
        fmt.format(date, result, fp);
View Full Code Here


          case 'a': // Abbreviated weekday name (Mon, Tue, etc.).
        fmt.applyPattern("EEE");
        fmt.format(date, result, fp);
        break;
          case 'A': // Full weekday name (Monday, Tuesday, etc.).
        fmt.applyPattern("EEEE");
        fmt.format(date, result, fp);
        break;
          case 'b': case 'h': // Abbreviated month name (Jan,Feb,etc.).
        fmt.applyPattern("MMM");
        fmt.format(date, result, fp);
View Full Code Here

          case 'A': // Full weekday name (Monday, Tuesday, etc.).
        fmt.applyPattern("EEEE");
        fmt.format(date, result, fp);
        break;
          case 'b': case 'h': // Abbreviated month name (Jan,Feb,etc.).
        fmt.applyPattern("MMM");
        fmt.format(date, result, fp);
        break;
          case 'B': // Full month name.
        fmt.applyPattern("MMMM");
        fmt.format(date, result, fp);
View Full Code Here

          case 'b': case 'h': // Abbreviated month name (Jan,Feb,etc.).
        fmt.applyPattern("MMM");
        fmt.format(date, result, fp);
        break;
          case 'B': // Full month name.
        fmt.applyPattern("MMMM");
        fmt.format(date, result, fp);
        break;
          case 'c': // Locale specific date and time.
        locFmt = (SimpleDateFormat)DateFormat.getDateTimeInstance(
                DateFormat.SHORT, DateFormat.SHORT);
View Full Code Here

          case 'C': // Century (00 - 99).
        int century = calendar.get(Calendar.YEAR)/100;
        result.append((century < 10 ? "0" : "") + century);
        break;
          case 'd': // Day of month (01 - 31).
        fmt.applyPattern("dd");
        fmt.format(date, result, fp);
        break;
          case 'D': // Date as %m/%d/%y.
        fmt.applyPattern("MM/dd/yy");
        fmt.format(date, result, fp);
View Full Code Here

          case 'd': // Day of month (01 - 31).
        fmt.applyPattern("dd");
        fmt.format(date, result, fp);
        break;
          case 'D': // Date as %m/%d/%y.
        fmt.applyPattern("MM/dd/yy");
        fmt.format(date, result, fp);
        break;
          case 'e': // Day of month (1 - 31), no leading zeros.
        fmt.applyPattern("d");
        String day = fmt.format(date);
View Full Code Here

          case 'D': // Date as %m/%d/%y.
        fmt.applyPattern("MM/dd/yy");
        fmt.format(date, result, fp);
        break;
          case 'e': // Day of month (1 - 31), no leading zeros.
        fmt.applyPattern("d");
        String day = fmt.format(date);
        result.append((day.length() < 2 ? " " : "") + day);
        break;
          case 'H': // Hour in 24-hour format (00 - 23).
        fmt.applyPattern("HH");
View Full Code Here

        fmt.applyPattern("d");
        String day = fmt.format(date);
        result.append((day.length() < 2 ? " " : "") + day);
        break;
          case 'H': // Hour in 24-hour format (00 - 23).
        fmt.applyPattern("HH");
        fmt.format(date, result, fp);
        break;
          case 'I': // Hour in 12-hour format (01 - 12).
        fmt.applyPattern("hh");
        fmt.format(date, result, fp);
View Full Code Here

          case 'H': // Hour in 24-hour format (00 - 23).
        fmt.applyPattern("HH");
        fmt.format(date, result, fp);
        break;
          case 'I': // Hour in 12-hour format (01 - 12).
        fmt.applyPattern("hh");
        fmt.format(date, result, fp);
        break;
          case 'j': // Day of year (001 - 366).
        fmt.applyPattern("DDD");
        fmt.format(date, result, fp);
View Full Code Here

          case 'I': // Hour in 12-hour format (01 - 12).
        fmt.applyPattern("hh");
        fmt.format(date, result, fp);
        break;
          case 'j': // Day of year (001 - 366).
        fmt.applyPattern("DDD");
        fmt.format(date, result, fp);
        break;
          case 'k': // Hour in 24-hour format (0 - 23), no leading zeros.
        fmt.applyPattern("H");
        String h24 = fmt.format(date);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.