List of utility methods to do SQL Date Format
String | dateFormat(Object obj, String parten) date Format if (obj == null) return null; if (parten == null || parten.trim().length() == 0) parten = "yyyy-MM-dd"; SimpleDateFormat dateFormat = new SimpleDateFormat(parten); if (obj instanceof java.sql.Date) { return dateFormat.format(obj); } else if (obj instanceof java.util.Date) { ... |
String | dateFormat(String sdate, String format) date Format SimpleDateFormat formatter = new SimpleDateFormat(format); java.sql.Date date = java.sql.Date.valueOf(sdate); String dateString = formatter.format(date); return dateString; |
String | dateFormatJson(Date date) date Format Json Calendar cal = Calendar.getInstance(); cal.setTime(date); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH) + 1; int day = cal.get(Calendar.DAY_OF_MONTH); return year + "," + month + "," + day; |
java.sql.Date | dateFromLong(Long longObject) Answer a Date from a long This implementation is based on the java.sql.Date class, not java.util.Date. return new java.sql.Date(longObject.longValue()); |
String | formataData(Date data) formata Data return formataData(data, "dd/MM/yyyy"); |
void | formatAsText(ResultSet result_set, PrintWriter out) Formats the ResultSet as plain mono-spaced text and outputs the result to the PrintWriter. ResultSetMetaData meta_data = result_set.getMetaData(); int[] max_widths = new int[meta_data.getColumnCount()]; Vector[] data = new Vector[meta_data.getColumnCount()]; for (int i = 0; i < data.length; ++i) { data[i] = new Vector(); int row_count = 0; for (int i = 0; i < data.length; ++i) { ... |
String | formatBytableCols(Object[] obj, String[] tableCols) format Bytable Cols StringBuffer result = new StringBuffer(); result.append("{"); if (obj != null && obj.length > 0) { for (int i = 0; i < obj.length; i++) { try { result.append(tableCols[i]); result.append(":'"); if (obj[i] instanceof String) { ... |
String | formatDate(java.util.Date uDate)formatDateDinh dang ngay kieu java.util.Date thanh String theo mau "dd/MM/yyyy"if (uDate == null) { return null; } else { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); return dateFormat.format(uDate); |
String | formatDate(Object obj) format Date String out = ""; if (obj == null) { return out; try { Date dateval = (Date) obj; if (dateval != null) { SimpleDateFormat dateformat = new SimpleDateFormat("MM/dd/yyyy"); ... |
String | formatDate(String date) format Date return formatDate(Integer.valueOf(date));
|