List of utility methods to do Date Now
String | getCurrentAccurateDateTimeStringForPrint() get Current Accurate Date Time String For Print SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); return df.format(new Date()); |
int | getCurrentAgeByBirthdate(String brithday) get Current Age By Birthdate try { Calendar cal = Calendar.getInstance(); int yearNow = cal.get(Calendar.YEAR); int monthNow = cal.get(Calendar.MONTH) + 1; int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); cal.setTime(dateFormat.parse(brithday)); int yearBirth = cal.get(Calendar.YEAR); int monthBirth = cal.get(Calendar.MONTH); ... |
String | getCurrentCacheTime() get Current Cache Time return getCacheValidatorTimeFormat().format(new Date()); |
Calendar | getCurrentCalendar() get Current Calendar Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String hehe = dateFormat.format(now); System.out.println(hehe); Calendar c = Calendar.getInstance(); return c; |
String | getCurrentCompactTime() get Current Compact Time Date NowDate = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); CurrentTime = formatter.format(NowDate); return CurrentTime; |
String | getCurrentDataInFormat(String pattern) get Current Data In Format return getOffsetDateInFormat(0, pattern);
|
String | getCurrentDataTimePrettyFilesystem() get Current Data Time Pretty Filesystem SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss"); Calendar calendar = new GregorianCalendar(); return simpleDateFormat.format(calendar.getTime()); |
String | getCurrentDate() A method to get the current date to use in a timestamp GregorianCalendar calendar = new GregorianCalendar(); DateFormat formatter = DateFormat.getDateInstance(DateFormat.FULL); return formatter.format(calendar.getTime()); |
int[] | getCurrentDate() get Current Date int[] dateBundle = new int[3]; String[] temp = getDataTime("yyyy-MM-dd").split("-"); for (int i = 0; i < 3; i++) { try { dateBundle[i] = Integer.parseInt(temp[i]); } catch (Exception e) { dateBundle[i] = 0; return dateBundle; |
Date | getCurrentDate() get Current Date Date currentDate = new Date(); SimpleDateFormat df = new SimpleDateFormat(dateFormat); df.format(currentDate); currentDate.getTime(); return currentDate; |