List of utility methods to do Date Now
String | getCurrentHMS() get Current HMS SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); Date date = new Date(); return sdf.format(date); |
String | getCurrentISO8601Date() get Current ISO Date String now = df.format(new Date()); return now; |
String | getCurrentJnlpTimestamp() get Current Jnlp Timestamp return getJnlpTimestamp(new Date()); |
String | getCurrentLastDate() get Current Last Date SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = null; try { java.util.Date date = formatter.parse(getCurrentFirstDate()); calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.MONTH, 1); calendar.add(Calendar.DAY_OF_YEAR, -1); ... |
Date | getCurrentLocaleTime() get Current Locale Time java.util.Calendar cal = java.util.Calendar.getInstance(java.util.Locale.CHINA); int zoneOffset = cal.get(java.util.Calendar.ZONE_OFFSET); int dstOffset = cal.get(java.util.Calendar.DST_OFFSET); cal.add(java.util.Calendar.MILLISECOND, -(zoneOffset + dstOffset)); return cal.getTime(); |
String | getCurrentMinutes() Returns the current minutes. return new java.text.SimpleDateFormat("m").format(new java.util.Date()); |
Integer | getCurrentMonth() get Current Month return getMonth(new Date()); |
String | getCurrentMonth() get Current Month Date current = new Date(System.currentTimeMillis()); return monthFormat.format(current); |
String | getCurrentMonth() get Current Month return getFormatCurrentTime("MM"); |
String | getCurrentMonth(boolean bool, String currentDate) get Current Month Calendar date1 = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date date = null; try { date = sdf.parse(currentDate); } catch (ParseException e) { e.printStackTrace(); date1.setTime(date); date1.set(Calendar.DATE, 1); if (bool) { } else { date1.add(Calendar.MONTH, 1); return sdf.format(date1.getTime()); |