List of utility methods to do Date Now
String | currentDateStr(String format) current Date Str return toString(format, now());
|
String | currentDateString() current Date String Date now = new Date(); return (DEFAULT_DATE_FORMAT.format(now)); |
int | currentDateTime(long time, int type) current Date Time Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
return calendar.get(type);
|
String | currentDateTimeMillis() current Date Time Millis Calendar dt = Calendar.getInstance(TimeZone.getDefault()); String strYear = dt.get(Calendar.YEAR) + ""; int iTmp = dt.get(Calendar.MONTH) + 1; String strMonth = iTmp + ""; String strDay = dt.get(Calendar.DAY_OF_MONTH) + ""; String hour = (dt.get(Calendar.HOUR_OF_DAY) < 10) ? "0" + dt.get(Calendar.HOUR_OF_DAY) : dt.get(Calendar.HOUR_OF_DAY) + ""; String minute = (dt.get(Calendar.MINUTE) < 10) ? "0" + dt.get(Calendar.MINUTE) ... |
String | currentDateTimeToEasySortedDateTime() Get the current date in an easy sorted format (e.g. return toEasySortedDateTime(new Date(System.currentTimeMillis())); |
String | currentGMTDateTime() current GMT Date Time TimeZone gmtTZ = TimeZone.getTimeZone("Europe/London"); Calendar gmtCalendar = GregorianCalendar.getInstance(); gmtCalendar.setTimeZone(gmtTZ); Date date = gmtCalendar.getTime(); return date.toString(); |
long | currentSystemDate() current System Date if (CurrentSystemDate - System.currentTimeMillis() > 120000) { Calendar calendar = Calendar.getInstance(GMT); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); CurrentSystemDate = calendar.getTimeInMillis(); return CurrentSystemDate; |
String | currentXdsDate(int format) current Xds Date TimeZone tz = TimeZone.getTimeZone("GMT"); Calendar cal = new GregorianCalendar(tz); return getXdsDate(cal, format); |
String | getCurrent() get Current SimpleDateFormat sdf = new SimpleDateFormat(commonDateFormat); Date curDate = new Date(); String strDate = sdf.format(curDate); return strDate; |
Date | getCurrent() get Current return getCurrent(DEFAULT_DATE_FORMAT);
|