Java Utililty Methods Now

List of utility methods to do Now

Description

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

Method

StringgetAllnowTime()
get Allnow Time
SimpleDateFormat df = new SimpleDateFormat(LONG_TIME_FORMAT);
String nowtime = df.format(Calendar.getInstance().getTime());
return nowtime;
StringgetDisplayDateNow()
get Display Date Now
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
String cs = formatter.format(date);
return cs;
StringgetFormatNowDateTime(String formatStr)
get Format Now Date Time
Calendar nowtime = Calendar.getInstance();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(formatStr);
return sdf.format(nowtime.getTime());
StringgetFormattedDateNow(@Nonnull final String sFormat)
get Formatted Date Now
return formatDate(sFormat, new Date());
StringgetInviteCodeByNowDate()
get Invite Code By Now Date
SimpleDateFormat sdf = new SimpleDateFormat("MMddHHmmssMs");
String dateStr = sdf.format(new Date());
return getRandomInteger() + dateStr;
StringgetShortNowTime()
get Short Now Time
return getNowTime(yyyyMMdd);
StringgetStringNowTime()
get String Now Time
Date date = new Date();
String dateStr = dateFormat(date);
return dateStr;
StringgetStringOfNowDate(String fFormatStr)
get String Of Now Date
String nowDateString = dateTypeToString(new Date(), fFormatStr);
return nowDateString;
StringgetTimeNow()
get Time Now
Calendar cal = Calendar.getInstance();
cal.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
return sdf.format(cal.getTime());
StringgetTimeNow(Date theTime)
This method returns the current date time in the format: MM/dd/yyyy HH:MM a
return getDateTime(timePattern, theTime);