List of utility methods to do Date to String
String | dateToStr(Date date, String format) date To Str String _timeZone = System.getProperty("user.timezone"); TimeZone timeZone = null; if (_timeZone == null || "".equals(_timeZone) || "UTC".equals(_timeZone)) { timeZone = TimeZone.getDefault(); } else { timeZone = TimeZone.getTimeZone("Asia/Shanghai"); SimpleDateFormat dateFormat = new SimpleDateFormat(format); ... |
String | dateToStr(Date date, String format) date To Str return new SimpleDateFormat(format).format(date); |
String | dateToStr(Date date, String formatstr) date To Str SimpleDateFormat format = new SimpleDateFormat(formatstr); return format.format(date); |
String | dateToStr(Date date, String formatType) date To Str return longTypeToStr(date.getTime(), formatType);
|
String | dateToStr(Date source) date To Str return dateToStr(source, "yyyy-MM-dd HH:mm:ss"); |
String | datetoStr2(Date date) dateto Str java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(FmtDateTime); String curDate = sdf.format(date); return curDate; |
String | dateToStr3(Date date) dateto Str if (date == null) { return ""; SimpleDateFormat sdate = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return sdate.format(date); |
String | dateToStrIBInput(Date date) date To Str IB Input try { return formatterIBInput.format(date); } catch (Exception e) { System.out.println("DateToStrIBInput Exception :" + e + " " + date); return null; |
String | dateToString(Date d) date To String if (d == null) return null; return dfDate.format(d); |
String | dateToString(Date d) date To String SimpleDateFormat sd = new SimpleDateFormat(DATE_FORMAT); String date = sd.format(d); return date; |