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 date)
format Date
SimpleDateFormat sdf = new SimpleDateFormat("mm:ss");
return sdf.format(new Date(date));
StringformatDate(Long date)
Formats a date.
if (date == null) {
    return null;
return formatDate(new Date(date));
StringformatDate(Long date, String fmt)
format Date
return getDateFormat(fmt).format(date);
StringformatDate(long date, String format)
format Date
final DateFormat dateFormat = new SimpleDateFormat(format);
if (date > 0)
    return dateFormat.format(date);
return null;
StringformatDate(long date, String langStr)
format Date
DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL,
        Locale.forLanguageTag(langStr));
return df.format(date);
StringformatDate(long dateValue)
format Date
return simpleFormat.format(new Date(dateValue));
StringformatDate(long epochMillis)
Standard Date/time format for CSV files
if (epochMillis != 0) {
    Date date = new Date(epochMillis);
    return DateFormat.getDateInstance(DateFormat.SHORT).format(date);
} else {
    return " ";
StringformatDate(long millis)
Format date for QuakeML
SimpleDateFormat dateF = new SimpleDateFormat(DATE_FORMAT);
dateF.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = new Date(millis);
return dateF.format(date);
StringformatDate(long millis)
Formats the given date (as elapsed milliseconds) using the default format 'yyyy/MM/dd HH:mm:ss'.
return DEFAULT_DATE.format(new Date(millis));
StringformatDate(long millis)
format Date
return date_sdf.format(new Date(millis));