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

StringgetCurrentTimeNoHour()
get Current Time No Hour
return getDate(new Date(), DEFAULT_FORMAT_NOHOUR);
StringgetCurrentTimeNumber()
get Current Time Number
return new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date());
StringgetCurrentTimeOfDay()
Delivers the current time in HH:mm:ss format.
return new SimpleDateFormat("HH:mm:ss").format(new Date());
StringgetCurrentTimeStamp()
Description - method to get current time stamp in GMT
SimpleDateFormat dateFormat = new SimpleDateFormat(TIME_FORMAT);
dateFormat.setTimeZone(TimeZone.getTimeZone(GMT_TIME_ZONE));
Date date = new Date();
return dateFormat.format(date);
StringgetCurrentTimeStamp()
This method returns the current system time as a HSQLDB TimeStamp String (E.g., '2008-08-08 20:08:08')
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String result = format.format(new java.util.Date());
return result;
StringgetCurrentTimestamp()
get Current Timestamp
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
String time = dateFormat.format(new Date());
return time;
StringgetCurrentTimestamp()
Returns the the current time in the yyyy-MM-dd'T'HH:mm:ssZ format.
long currentTime;
SimpleDateFormat timestampDateFormat;
currentTime = Calendar.getInstance().getTimeInMillis();
timestampDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
timestampDateFormat.setTimeZone(new SimpleTimeZone(0, "Z"));
return timestampDateFormat.format(currentTime) + "Z";
StringgetCurrentTimeStamp()
Get the current date and time.
SimpleDateFormat sdfDate = new SimpleDateFormat("dd-MM-yyyy_HH_mm_ss");
Date now = new Date();
return sdfDate.format(now);
StringgetCurrentTimestamp()
get Current Timestamp
synchronized (ISO_TIMESTAMP_FORMAT) {
    return ISO_TIMESTAMP_FORMATTER.format(now());
StringgetCurrentTimestampAsISOString()
get Current Timestamp As ISO String
return getDateAsISOTimestampString(new Date());