Examples of applyPattern()


Examples of java.text.SimpleDateFormat.applyPattern()

                SimpleDateFormat format = session.getSimpleDateFormatGMT();
                String javaPattern =
                    HsqlDateTime.toJavaDatePattern((String) data[1]);

                try {
                    format.applyPattern(javaPattern);
                } catch (Exception e) {
                    throw Error.error(ErrorCode.X_22511);
                }

                Date date =
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

        try
        {
          SimpleDateFormat dateFormat = new SimpleDateFormat(formatsIn[i]);
          dateFormat.setLenient(false);
          Date dt = dateFormat.parse(in);         
          dateFormat.applyPattern(formatOut);
          return dateFormat.format(dt);
        }
        catch (ParseException pe)
        {
          // If ParseException occurred during input string, input is invalid.
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

    }

    public static String format(final Date date, final boolean lenient, final String conversionPattern) {
        SimpleDateFormat sdf = DATE_FORMAT.get();
        if (conversionPattern != null) {
            sdf.applyPattern(conversionPattern);
        }
        sdf.setLenient(lenient);
        return sdf.format(date);
    }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

        return DateUtils.parseDate(source, SyncopeConstants.DATE_PATTERNS);
    }

    public static Date parseDate(final String source, final String conversionPattern) throws ParseException {
        SimpleDateFormat sdf = DATE_FORMAT.get();
        sdf.applyPattern(conversionPattern);
        sdf.setLenient(false);
        return sdf.parse(source);
    }

    public static Number parseNumber(final String source, final String conversionPattern) throws ParseException {
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

      if (dateParser == null) {
        dateParser = new SimpleDateFormat(format, Locale.US);
        dateParser.setTimeZone(GMT);
        dateParser.set2DigitYearStart(startDate);
      } else {
        dateParser.applyPattern(format);
      }
      try {
        return dateParser.parse(dateValue);
      } catch (ParseException pe) {
        // ignore this exception, we will try the next format
View Full Code Here

Examples of net.sf.mpxj.utility.MPXJNumberFormat.applyPattern()

    */
   private void processCurrency(Row row)
   {
      String currencyName = row.getString("curr_short_name");
      MPXJNumberFormat nf = new MPXJNumberFormat();
      nf.applyPattern("#.#", null, row.getString("decimal_symbol").charAt(0), row.getString("digit_group_symbol").charAt(0));
      m_currencyMap.put(currencyName, nf);

      if (currencyName.equalsIgnoreCase(m_defaultCurrencyName))
      {
         m_numberFormat = nf;
View Full Code Here

Examples of org.jruby.util.RubyDateFormat.applyPattern()

    }

    @JRubyMethod(name = "strftime", required = 1)
    public RubyString strftime(IRubyObject format) {
        final RubyDateFormat rubyDateFormat = new RubyDateFormat("-", Locale.US);
        rubyDateFormat.applyPattern(format.toString());
        rubyDateFormat.setDateTime(dt);
        String result = rubyDateFormat.format(null);
        return getRuntime().newString(result);
    }
   
View Full Code Here

Examples of org.outerj.i18n.DateFormat.applyPattern()

        String pattern = (String)localizedPatterns.get(locale);

        if (pattern != null)
            dateFormat.applyLocalizedPattern(pattern);
        else if (nonLocalizedPattern != null)
            dateFormat.applyPattern(nonLocalizedPattern);

        return dateFormat;
    }

    public Class getTypeClass() {
View Full Code Here

Examples of org.outerj.i18n.DecimalFormat.applyPattern()

        String pattern = (String)localizedPatterns.get(locale);

        if (pattern != null)
            decimalFormat.applyLocalizedPattern(pattern);
        else if (nonLocalizedPattern != null)
            decimalFormat.applyPattern(nonLocalizedPattern);

        return decimalFormat;
    }

    public void setVariant(int variant) {
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.