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

Stringnow()
now
Calendar cal = Calendar.getInstance();
return stringFormatADate(Calendar.getInstance().getTime());
Stringnow()
now
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return sdf.format(cal.getTime());
Datenow()
now
return new Date();
Stringnow()
Method to return the current time in the form: yyyy-MM-dd HH:mm:ss
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date d = new Date();
return sdf.format(d);
Stringnow()
Get today's date.
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(cal.getTime());
Datenow()
now
return new Date();
DateNow()
Now
return dateFormat.parse(format());
Stringnow()
now
return sdf.format(new Date());
Datenow()
now
return new Date(System.currentTimeMillis());
Stringnow()
now
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
Date date = new Date();
return dateFormat.format(date);