Package java.text

Examples of java.text.SimpleDateFormat.applyPattern()


          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);
        result.append((h24.length() < 2 ? " " : "") + h24);
        break;
          case 'l': // Hour in 12-hour format (1 - 12), no leading zeros.
        fmt.applyPattern("h");
View Full Code Here


        fmt.applyPattern("H");
        String h24 = fmt.format(date);
        result.append((h24.length() < 2 ? " " : "") + h24);
        break;
          case 'l': // Hour in 12-hour format (1 - 12), no leading zeros.
        fmt.applyPattern("h");
        String h12 = fmt.format(date);
        result.append((h12.length() < 2 ? " " : "") + h12);
        break;
          case 'm': // Month number (01 - 12).
        fmt.applyPattern("MM");
View Full Code Here

        fmt.applyPattern("h");
        String h12 = fmt.format(date);
        result.append((h12.length() < 2 ? " " : "") + h12);
        break;
          case 'm': // Month number (01 - 12).
        fmt.applyPattern("MM");
        fmt.format(date, result, fp);
        break;
          case 'M': // Minute (00 - 59).
        fmt.applyPattern("mm");
        fmt.format(date, result, fp);
View Full Code Here

          case 'm': // Month number (01 - 12).
        fmt.applyPattern("MM");
        fmt.format(date, result, fp);
        break;
          case 'M': // Minute (00 - 59).
        fmt.applyPattern("mm");
        fmt.format(date, result, fp);
        break;
          case 'n': // Insert a newline.
        result.append('\n');
        break;
View Full Code Here

        break;
          case 'n': // Insert a newline.
        result.append('\n');
        break;
          case 'p': // AM/PM indicator.
        fmt.applyPattern("aa");
        fmt.format(date, result, fp);
        break;
          case 'r': // Time as %I:%M:%S %p.
        fmt.applyPattern("KK:mm:ss aaaa");
        fmt.format(date, result, fp);
View Full Code Here

          case 'p': // AM/PM indicator.
        fmt.applyPattern("aa");
        fmt.format(date, result, fp);
        break;
          case 'r': // Time as %I:%M:%S %p.
        fmt.applyPattern("KK:mm:ss aaaa");
        fmt.format(date, result, fp);
        break;
          case 'R': // Time as %H:%M.
        fmt.applyPattern("hh:mm");
        fmt.format(date, result, fp);
View Full Code Here

          case 'r': // Time as %I:%M:%S %p.
        fmt.applyPattern("KK:mm:ss aaaa");
        fmt.format(date, result, fp);
        break;
          case 'R': // Time as %H:%M.
        fmt.applyPattern("hh:mm");
        fmt.format(date, result, fp);
        break;
          case 's': // seconds since epoch.
        result.append((int) (calendar.getTime().getTime()/1000));
        break;
View Full Code Here

        break;
          case 's': // seconds since epoch.
        result.append((int) (calendar.getTime().getTime()/1000));
        break;
          case 'S': // Seconds (00 - 59).
        fmt.applyPattern("ss");
        fmt.format(date, result, fp);
        break;
          case 't': // Insert a tab.
        result.append('\t');
        break;
View Full Code Here

        break;
          case 't': // Insert a tab.
        result.append('\t');
        break;
          case 'T': // Time as %H:%M:%S.
        fmt.applyPattern("hh:mm:ss");
        fmt.format(date, result, fp);
        break;
          case 'u': // Weekday number (1 - 7) Sunday = 7.
        int dayOfWeek17 = calendar.get(Calendar.DAY_OF_WEEK);
        if (dayOfWeek17 == calendar.SUNDAY) {
View Full Code Here

               DateFormat.SHORT);
        locFmt.setCalendar(calendar);
        locFmt.format(date, result, fp);
        break;
          case 'y': // Year without century (00 - 99).
        fmt.applyPattern("yy");
        fmt.format(date, result, fp);
        break;
          case 'Y': // Year with century (e.g. 1990)
        fmt.applyPattern("yyyy");
        fmt.format(date, result, fp);
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.