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

StringgetCurrentDateTime()
get Current Date Time
Date d = new Date();
SimpleDateFormat df = new SimpleDateFormat();
df.applyPattern("yyyy/MM/dd HH:mm:ss");
return df.format(d);
StringgetCurrentDateTime()
get Current Date Time
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");
String dateNow = formatter.format(currentDate.getTime());
return dateNow;
StringgetCurrentDateTime()
get Current Date Time
Date today = new Date();
Locale currentLocale = new Locale("KOREAN", "KOREA");
String pattern = "yyyyMMddHHmmss";
SimpleDateFormat formatter = new SimpleDateFormat(pattern, currentLocale);
return formatter.format(today);
StringgetCurrentDateTime()
get Current Date Time
SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_DATE_TIME_FORMAT);
return sdf.format(new Date());
StringgetCurrentDateTime()
get Current Date Time
String s = "";
Format formatter;
Date rightNow = new Date();
formatter = new SimpleDateFormat("EEEE , dd MMM yyyy HH:mm:ss");
s = formatter.format(rightNow);
return s;
DategetCurrentDateTime()
get Current Date Time
return Calendar.getInstance().getTime();
StringgetCurrentDateTime()
Gets the current date time.
String ranNum = "";
DateFormat formatter = new SimpleDateFormat("MMM");
SimpleDateFormat monthParse = new SimpleDateFormat("MM");
DateFormat dformatter = new SimpleDateFormat("DD");
SimpleDateFormat dateParse = new SimpleDateFormat("DD");
Calendar cal = Calendar.getInstance();
String month = Integer.toString(cal.get(Calendar.MONTH) + 1);
String date = Integer.toString(cal.get(Calendar.DATE) + 1);
...
StringgetCurrentDateTime()
This method provide the current date and current time
java.util.Date today = new java.util.Date();
String currentDateTime = userTimeFmt.format(today);
return currentDateTime;
StringgetCurrentDateTime(String dateFormat)
get Current Date Time
return timeMillisToString(System.currentTimeMillis(), dateFormat);
StringgetCurrentDateTime(String format)
get Current Date Time
return millisToDateTime(System.currentTimeMillis(), format);