Java Utililty Methods Date Time to String

List of utility methods to do Date Time to String

Description

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

Method

StringdateTimeToString(Calendar dateTime)
date Time To String
if (dateTime == null)
    return null;
return FORMAT_DATE_TIME.format(dateTime.getTime());
StringdateTimeToString(Date d)
date Time To String
if (d == null)
    return null;
return dfDateTime.format(d);
StringdateTimeToString(Date d)
date Time To String
c1.setTime(d);
Date date = c1.getTime();
String strDate = "";
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm");
strDate = sdf.format(date);
return strDate;
StringdateTimeToString(Date date)
date Time To String
return dt.format(date);
StringDateTimeToString(Date date)
Date Time To String
String _pattern = "yyyy-MM-dd HH:mm:ss";
return date == null ? null : DateToString(date, _pattern);
StringdateTimeToString(Date date)
Pretvara datum i vrijeme u tekst (format "yyyy-MM-dd HH:mm:ss").
if (date == null)
    return "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(date);
StringdateTimeToString(Date date)
date Time To String
Format format = getDateFormater();
String timeToSeconds = format.format(date);
return timeToSeconds;
StringdateTimeToString(Date date, String formatter)
date Time To String
if (date == null) {
    return "";
DateFormat df = new SimpleDateFormat(formatter);
return df.format(date);
StringdateTimeToString(final Date date)
Convert the date time to string ( #TIME_FORMAT ).
DateFormat formatterTime = new SimpleDateFormat(TIME_FORMAT);
String timeString = formatterTime.format(date);
return timeString;
StringdateTimeToString(final Date date)
Date time to string.
String result = "";
result = DATE_TIME.format(date);
return result;