List of utility methods to do Time Format
SimpleDateFormat | timeFormatter() time Formatter return dateFormatter(TIME_FORMAT_HU);
|
String | timestr(String format, long secs) timestr SimpleDateFormat sdf; Date date; sdf = new SimpleDateFormat(format); date = new Date(secs * 1000); return sdf.format(date); |
String | timeToString(String format, Date date) time To String DateFormat df = new SimpleDateFormat(format); return df.format(date); |
String | toSQLDateTimeFormat(Calendar cal) create a SQL-friendly datetime string from a Java Calendar if (cal == null) return null; return toSQLDateTimeFormat(cal.getTime()); |
String | toString(Date time, String format) to String SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); return simpleDateFormat.format(time); |
String | toString(String format, long time) to String return toString(TimeZone.getDefault(), format, time);
|
String | toString(String format, long time) to String return new SimpleDateFormat(format).format(time); |
String | toStringFormatTime(long time, String format) to String Format Time SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new java.util.Date(time)); |
Date | tryToParse(String datetime, SimpleDateFormat format) try To Parse try { return format.parse(datetime); } catch (ParseException e) { return null; |
boolean | validateDatetimeString(String datetimeString, String format) validate Datetime String if (datetimeString == null || datetimeString.equals("")) { return false; SimpleDateFormat sdf = new SimpleDateFormat(format); try { sdf.parse(datetimeString); return true; } catch (ParseException e) { ... |