public static DateTime toDateTime(Locale locale,String str,TimeZone tz,boolean useCommomDateParserAsWell) throws PageException {
  DateTime dt=toDateTime(locale,str,tz,null,useCommomDateParserAsWell);
  if (dt == null) {
    String prefix=locale.getLanguage() + "-" + locale.getCountry()+ "-";
    throw new ExpressionException("can't cast [" + str + "] to date value","to add custom formats for " + LocaleFactory.toString(locale) + ", create/extend on of the following files ["+ prefix+ "datetime.df (for date time formats), "+ prefix+ "date.df (for date formats) or "+ prefix+ "time.df (for time formats)] in the following directory [<context>/lucee/locales]."+ "");
  }
  return dt;
}

public static DateTime toDateTime ( Locale locale , String str , TimeZone tz , boolean useCommomDateParserAsWell ) throws PageException { DateTime dt = toDateTime ( locale , str , tz , null , useCommomDateParserAsWell ) ; if ( dt == null ) { String prefix = locale . getLanguage ( ) + "-" + locale . getCountry ( ) + "-" ; throw new ExpressionException ( "can't cast [" + str + "] to date value" , "to add custom formats for " + LocaleFactory . toString ( locale ) + ", create/extend on of the following files [" + prefix + "datetime.df (for date time formats), " + prefix + "date.df (for date formats) or " + prefix + "time.df (for time formats)] in the following directory [<context>/lucee/locales]." + "" ) ; } return dt ; }
parse a string to a datetime object
