Java Utililty Methods Long Number to Date

List of utility methods to do Long Number to Date

Description

The list of methods to do Long Number to Date are organized into topic(s).

Method

StringformatDate(long millis, Locale locale)
format Date
Date d = new Date();
d.setTime(millis);
return formatDate(d, locale);
StringformatDate(long millis, String dateFormat)
format Date
SimpleDateFormat sdf = new SimpleDateFormat();
if (dateFormat == null) {
    throw new NullPointerException("Date format cannot be null. Please provide valid date format.");
sdf.applyPattern(dateFormat);
return sdf.format(new Date(millis));
StringformatDate(long millisecond, String format)
format Date
DateFormat dateFormat = new SimpleDateFormat(format);
Date date = new Date(millisecond);
return dateFormat.format(date);
StringformatDate(long ms)
format Date
return formatDate(new Date(ms), defaultFormat);
StringformatDate(long ms)
format Date
return formatDate(new Date(ms));
StringformatDate(long p_millis)
Formats an epoch date in a standard way: MM/dd/yyyy
Date date = new Date(p_millis);
DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
return formatter.format(date);
StringformatDate(long t)
format Date
if (t <= 0)
    return "";
java.text.DateFormat format1 = new java.text.SimpleDateFormat("hh:mm:ss");
return format1.format(new Date(t));
StringformatDate(long time)
format Date
return formatDate(new Date(time));
StringformatDate(long time)
format Date
SimpleDateFormat format = getDateFormat();
Calendar calendar = getCalendar(time);
return format.format(calendar.getTime());
StringformatDate(long time)
format Date
return formatDate(new Date(time));