List of utility methods to do SQL Date Convert
String | dateToStamp(String date) date To Stamp try { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(TIME_FORMAT); Date date1 = simpleDateFormat.parse(date); long ts = date1.getTime() / 1000; return String.valueOf(ts); } catch (Exception e) { return String.valueOf(getDateStamp() / 1000); ... |
String | dateToSTR(Date data, String formato) Formata um objeto java.sql.Date para String no formato passado como parametro. if (data == null) return ""; SimpleDateFormat spd = new SimpleDateFormat(formato); return spd.format(data).trim(); |
String | dateToStr(java.util.Date date) date To Str if (date == null) { return null; } else { return (new SimpleDateFormat(simDateFormat)).format(date); |
String | dateToString(Date date) date To String return dateToString(date, DEFAULT_DATETIME_PATTERN_WITHOUT_MILLISECONDS);
|
String | dateToString(Date date, String format) Description:Change the java.sql.Timestamp format to java.util.String format try { SimpleDateFormat myFormatter = new SimpleDateFormat(format); return myFormatter.format(date); } catch (Exception err) { return ""; |
String | dateToString(java.sql.Date d) dateToString takes a JDBC date and makes it a mm/dd string if (d == null) return ""; String s = d.toString(); if (s == null) if (s.equals("null")) return ""; StringTokenizer tk = new StringTokenizer(s, "-"); int yr = Integer.parseInt(tk.nextToken()); ... |
String | dateToString(java.sql.Date data) date To String String dta; SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); dta = sdf.format(data); return dta; |
String | dateToString(java.sql.Date datee) date To String return datee.toString();
|
String | dateToString(java.util.Date date, String dateFmt) date To String String strTemp = null; if (date != null) { String dtFmt = dateFmt; if (null == dtFmt) dtFmt = "yyyy-MM-dd"; SimpleDateFormat formatter = new SimpleDateFormat(dtFmt); strTemp = formatter.format(date); return strTemp; |
String | to2GMTString(final Date tsStart, final Date tsEnd) to GMT String return timestampToString(new Timestamp(tsStart.getTime()), STANDARD_DATETIMEFORMAT, TZ_UTC) + " - " + timestampToString(new Timestamp(tsEnd.getTime()), STANDARD_DATETIMEFORMAT, TZ_UTC) + " GMT"; |