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

StringconvertDateFromTimeStamp(long timeStamp, String dateFormat)
convert Date From Time Stamp
Date date = new Date(timeStamp);
DateFormat format = new SimpleDateFormat(dateFormat);
return format.format(date);
StringconvertDateToString(long value)
Converts the date value to string.
return DATE_FORMAT.format(new Date(value));
StringconvertDecimal(long l)
Converts a given number to a value in KiloByte.
long l2 = l / 1024;
if (l2 == 0 && l != 0)
    l2 = 1;
return nf.format(l2) + " KB";
longconverteDataStr2Long(String str)
converte Data Str Long
Date date = new Date();
String temp = str.substring(0, 4);
date.setYear(Integer.valueOf(temp).intValue() - 1900);
temp = str.substring(5, 7);
date.setMonth(Integer.valueOf(temp).intValue() - 1);
temp = str.substring(8, 10);
date.setDate(Integer.valueOf(temp).intValue());
temp = str.substring(11, 13);
...
StringconvertFromLongToString(SimpleDateFormat fm, long date)
convert From Long To String
return fm.format(date);
StringconvertHours2DatetimeString(long nodeTaskCompleteTime)
convert Hours Datetime String
return LEFTFALLING_STROKE_FORMAT.format(new Date(nodeTaskCompleteTime));
StringconvertMillisecondToDateTimeString(long millisecond, String mark)
Description :Convert millisecond to dateTime.
Date _date = new Date(millisecond);
return getDateTime(mark, _date);
DateconvertMMDDYYYYToDate(String date)
Converts a string object in the form MM/dd/YYYY into a date object.
return MMDDYYYYFormat.parse(date);
StringconvertMsToDate(long millis)
Converts milliseconds to date.
DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss:SSS");
return formatter.format(new Date(millis));
StringconvertMsToSimpleDate(long Millis)
convert Ms To Simple Date
DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy");
return formatter.format(new Date(Millis));