Java Utililty Methods Date Now

List of utility methods to do Date Now

Description

The list of methods to do Date Now are organized into topic(s).

Method

StringgetCurrentHMS()
get Current HMS
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
Date date = new Date();
return sdf.format(date);
StringgetCurrentISO8601Date()
get Current ISO Date
String now = df.format(new Date());
return now;
StringgetCurrentJnlpTimestamp()
get Current Jnlp Timestamp
return getJnlpTimestamp(new Date());
StringgetCurrentLastDate()
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);
...
DategetCurrentLocaleTime()
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();
StringgetCurrentMinutes()
Returns the current minutes.
return new java.text.SimpleDateFormat("m").format(new java.util.Date());
IntegergetCurrentMonth()
get Current Month
return getMonth(new Date());
StringgetCurrentMonth()
get Current Month
Date current = new Date(System.currentTimeMillis());
return monthFormat.format(current);
StringgetCurrentMonth()
get Current Month
return getFormatCurrentTime("MM");
StringgetCurrentMonth(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());