Example usage for java.text DateFormatSymbols setLocalPatternChars

List of usage examples for java.text DateFormatSymbols setLocalPatternChars

Introduction

In this page you can find the example usage for java.text DateFormatSymbols setLocalPatternChars.

Prototype

public void setLocalPatternChars(String newLocalPatternChars) 

Source Link

Document

Sets localized date-time pattern characters.

Usage

From source file:com.panet.imeta.core.util.StringUtil.java

public static Date str2dat(String arg0, String arg1, String val) throws KettleValueException {
    SimpleDateFormat df = new SimpleDateFormat();

    DateFormatSymbols dfs = new DateFormatSymbols();
    if (arg1 != null)
        dfs.setLocalPatternChars(arg1);
    if (arg0 != null)
        df.applyPattern(arg0);/*from www  .j a va2s .  co  m*/

    try {
        return df.parse(val);
    } catch (Exception e) {
        throw new KettleValueException("TO_DATE Couldn't convert String to Date " + e.toString());
    }
}

From source file:org.pentaho.di.core.util.StringUtil.java

public static Date str2dat(String arg0, String arg1, String val) throws KettleValueException {
    SimpleDateFormat df = new SimpleDateFormat();

    DateFormatSymbols dfs = new DateFormatSymbols();
    if (arg1 != null) {
        dfs.setLocalPatternChars(arg1);/*w ww .j a  v  a2 s  .  c  om*/
    }
    if (arg0 != null) {
        df.applyPattern(arg0);
    }

    try {
        return df.parse(val);
    } catch (Exception e) {
        throw new KettleValueException("TO_DATE Couldn't convert String to Date " + e.toString());
    }
}

From source file:org.openossad.util.core.util.StringUtil.java

public static Date str2dat(String arg0, String arg1, String val) throws OpenDESIGNERValueException {
    SimpleDateFormat df = new SimpleDateFormat();

    DateFormatSymbols dfs = new DateFormatSymbols();
    if (arg1 != null)
        dfs.setLocalPatternChars(arg1);
    if (arg0 != null)
        df.applyPattern(arg0);//from ww w  .j  a v a2  s .  c  o  m

    try {
        return df.parse(val);
    } catch (Exception e) {
        throw new OpenDESIGNERValueException("TO_DATE Couldn't convert String to Date " + e.toString());
    }
}