Examples of applyPattern()


Examples of java.text.SimpleDateFormat.applyPattern()

          } // then (oldFormat == null || oldFormat.length() == 0)
          else
          {
            formater = new SimpleDateFormat(oldFormat);
            date = formater.parse(keyName);
            formater.applyPattern(newFormat);
          } // else (oldFormat == null || oldFormat.length() == 0)
          String value = formater.format(date);

          insertValue(tagName, value, parent, node);
        } // then (styletName.equals("FormatDate"))
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

        try
        {
          SimpleDateFormat dateFormat = new SimpleDateFormat(formatsIn[i], Locale.ENGLISH);
          dateFormat.setLenient(false);
          Date dt = dateFormat.parse(in);         
          dateFormat.applyPattern(formatOut);
          return dateFormat.format(dt);
        }
        catch (ParseException pe)
        {
        }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

  public static String formatDate(Date date) {
    DateFormat formatter = DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US);
    try {
      SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
      simpleFormatter.applyPattern("EEE, d MMM yyyy kk:mm:ss z");
      String result = simpleFormatter.format(date);
      return result;
    } catch (Exception e) {
      // Simple formatter not supported.
    }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

    if (pString != null && !"".equals(pString)) {
      SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
      for (int i = 0; i < lDateFormats.length; i++) {
        String lFormat = lDateFormats[i];
        simpleFormatter.applyPattern(lFormat);
        try {
          lDate = simpleFormatter.parse(pString);
          break;
        } catch (ParseException pe) {
          // keep trying.
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

  public static String formatSmartDate(Date date) {
    DateFormat formatter = DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US);
    try {
      SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
      simpleFormatter.applyPattern("yy-MM-dd");
      String result = simpleFormatter.format(date);
      return result;
    } catch (Exception e) {
      // Simple formatter not supported.
    }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

  public static String formatDate(Date date, String pPatern) {
    DateFormat formatter = DateFormat.getDateTimeInstance(
        DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US);
    try {
      SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
      simpleFormatter.applyPattern(pPatern);
      String result = simpleFormatter.format(date);
      return result;
    } catch (Exception e) {
      // Simple formatter not supported.
    }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

    {
      if (locPattern) {
        formatter.applyLocalizedPattern(pattern);
      }
      else {
        formatter.applyPattern(pattern);
      }
    }
    return formatter.parse((String) value);
  }
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

    return statisticResult;
  }

  private String getWeek(Date date) {
    SimpleDateFormat sdf = new SimpleDateFormat();
    sdf.applyPattern("ww");
    return sdf.format(date);
  }

  private String getYear(Date date) {
    SimpleDateFormat sdf = new SimpleDateFormat();
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

    return sdf.format(date);
  }

  private String getYear(Date date) {
    SimpleDateFormat sdf = new SimpleDateFormat();
    sdf.applyPattern("yyyy");
    return sdf.format(date);
  }

  /** fill any gaps in the column headers between the first and the last days **/
  private void fillGapsInColumnHeaders(StatisticResult statisticResult) {
View Full Code Here

Examples of java.text.SimpleDateFormat.applyPattern()

        }

        SimpleDateFormat format = session.getSimpleDateFormatGMT();

        try {
            format.applyPattern(javaPattern);
        } catch (Exception e) {}

        Date date = (Date) convertSQLToJavaGMT(session, dateTime);

        return format.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.