List of utility methods to do SQL Date Parse
java.sql.Date | parseUtilDateToSqlDate(Date date) parse Util Date To Sql Date return new java.sql.Date(date.getTime()); |
Date | stringToDate(final String dateString) string To Date SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date = null; try { date = sdf.parse(dateString); } catch (ParseException e1) { try { date = Timestamp.valueOf(dateString); } catch (IllegalArgumentException expected) { ... |
Date | stringToDate(String date) string To Date return java.sql.Date.valueOf(date);
|
Date | stringToDate(String date, Class> dateType) string To Date try { Date dat = getSimpleDateFormat().parse(date); if (dateType.equals(java.sql.Date.class)) return new java.sql.Date(dat.getTime()); else if (dateType.equals(Time.class)) return new Time(dat.getTime()); else if (dateType.equals(Timestamp.class)) return new Timestamp(dat.getTime()); ... |
java.sql.Date | stringToDate(String dateStr) string To Date return java.sql.Date.valueOf(dateStr);
|
java.sql.Date | stringToDate(String dta) string To Date java.sql.Date data; int dia = Integer.parseInt(dta.substring(0, 2)); int mes = Integer.parseInt(dta.substring(3, 5)); int ano = Integer.parseInt(dta.substring(6, 10)); data = new java.sql.Date(ano - 1900, mes - 1, dia); return data; |
Date | stringToDate(String str) string To Date Date date = null; try { date = java.sql.Date.valueOf(str); } catch (Exception e) { e.printStackTrace(); return date; |
Date | stringToDate(String str) string To Date return stringToDate(str, DEFAULT_DATE_PATTERN);
|
Timestamp | StringToDateHMS(String str) String To Date HMS Timestamp time = null;
time = Timestamp.valueOf(str);
return time;
|
java.sql.Date | stringToSqlDate(String data) string To Sql Date if (data == null) { return null; data = data.trim(); if (PADRAO_DATA_YYYYMMDD.matcher(data).matches()) { data = data.replace('/', '-'); } else if (PADRAO_DATA_DDMMYYYY.matcher(data).matches()) { String dt[] = data.split("[/-]"); ... |