List of utility methods to do Time Get
String | getFormatTime(Date date) get Format Time return getFormatDateTime(date, "yyyy-MM-dd HH:mm:ss"); |
String | getCurTimeByFormat(String format) get Cur Time By Format Date newdate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(newdate); |
String | getCurTimeByFormat(String format) get Cur Time By Format Date newdate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(newdate); |
String | getCurrentTime(String dateFormat) Returns current time with default `DATE_FORMAT` return formatDate(Calendar.getInstance().getTime(), dateFormat);
|
Date | getDate(String time) get Date Date date = new Date(System.currentTimeMillis()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); try { date = format.parse(time); } catch (ParseException e) { e.printStackTrace(); return date; ... |
Date | getDate(String time) get Date Date date = new Date(System.currentTimeMillis()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); try { date = format.parse(time); } catch (ParseException e) { e.printStackTrace(); return date; ... |
String | getDateLabel(long time) get Date Label SimpleDateFormat sdf = new SimpleDateFormat( SettingsFormatUtils.getDateFormat()); return sdf.format(new Date(time)); |
String | getDateTime() get Date Time SimpleDateFormat dateFormat = new SimpleDateFormat(DATABASEFORMAT, Locale.getDefault()); Date date = new Date(); return dateFormat.format(date); |
String | getDateTime(String format) get Date Time SimpleDateFormat dateFormat = new SimpleDateFormat(format, Locale.getDefault()); Date date = new Date(); return dateFormat.format(date); |
DateTime | getDateTimeFromCal(Calendar cal) get Date Time From Cal DateTime dateTime = new DateTime(); dateTime.year = cal.get(Calendar.YEAR); dateTime.month = cal.get(Calendar.MONTH) + 1; dateTime.day = cal.get(Calendar.DAY_OF_MONTH); dateTime.hour = cal.get(Calendar.HOUR_OF_DAY); dateTime.minute = cal.get(Calendar.MINUTE); return dateTime; |