List of utility methods to do String to Date
String | toDateString(Date date, String format) Date converted to string in specified format. SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); |
String | toDateString(Date date, String format) to Date String SimpleDateFormat sf = new SimpleDateFormat(format); return sf.format(date); |
String | toDateString(Date date, String formatPattern) Formats date instance using the provided date format pattern if (date == null) { return ""; SimpleDateFormat format = new SimpleDateFormat(formatPattern); return format.format(date); |
String | toDateString(Date date, TimeZone timezone) to Date String if (date == null) return null; if (timezone == null) timezone = TimeZone.getDefault(); SimpleDateFormat dbFmt = new SimpleDateFormat("yyyy/MM/dd"); dbFmt.setTimeZone(timezone); return dbFmt.format(date); |
String | toDateString(final Date date) to Date String return toDateString(date, defaultDatePattern);
|
String | toDateString(java.util.Date date) Makes a date String in the format MM/DD/YYYY from a Date if (date == null) return ""; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int month = calendar.get(Calendar.MONTH) + 1; int day = calendar.get(Calendar.DAY_OF_MONTH); int year = calendar.get(Calendar.YEAR); String monthStr; ... |
String | toDateString(java.util.Date date) Makes a date String in the format MM/DD/YYYY from a Date if (date == null) return ""; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int month = calendar.get(Calendar.MONTH) + 1; int day = calendar.get(Calendar.DAY_OF_MONTH); int year = calendar.get(Calendar.YEAR); String monthStr; ... |
String | toDateString(java.util.Date date, String format) Makes a date String in the given from a Date if (date == null) return ""; SimpleDateFormat dateFormat = null; if (format != null) { dateFormat = new SimpleDateFormat(format); } else { dateFormat = new SimpleDateFormat(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return dateFormat.format(date); |
String | toDateString(java.util.Date date, String spe) to Date String if (date == null) return ""; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int month = calendar.get(Calendar.MONTH) + 1; int day = calendar.get(Calendar.DAY_OF_MONTH); int year = calendar.get(Calendar.YEAR); String monthStr = "" + month; ... |
String | toDateString(long lval) Returns the string for the given long as a date. return dateFormat.format(new Date(lval)); |