Java Long Number to Date convertMillisecondToDateTimeString(long millisecond, String mark)

Here you can find the source of convertMillisecondToDateTimeString(long millisecond, String mark)

Description

Description :Convert millisecond to dateTime.

License

Open Source License

Parameter

Parameter Description
millisecond a parameter
mark a parameter

Declaration

public static String convertMillisecondToDateTimeString(long millisecond, String mark) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**// w  w  w .j a  v a 2  s .  c  om
     * Description :Convert millisecond to dateTime.
     * 
     * @param millisecond
     * @param mark
     * @return
     */
    public static String convertMillisecondToDateTimeString(long millisecond, String mark) {
        Date _date = new Date(millisecond);

        return getDateTime(mark, _date);
    }

    public static String getDateTime(String aMask, Date aDate) {
        String returnValue = "";

        if (aDate != null) {
            SimpleDateFormat df = new SimpleDateFormat(aMask);
            returnValue = df.format(aDate);
        }

        return (returnValue);
    }
}

Related

  1. convertDateToString(long value)
  2. convertDecimal(long l)
  3. converteDataStr2Long(String str)
  4. convertFromLongToString(SimpleDateFormat fm, long date)
  5. convertHours2DatetimeString(long nodeTaskCompleteTime)
  6. convertMMDDYYYYToDate(String date)
  7. convertMsToDate(long millis)
  8. convertMsToSimpleDate(long Millis)
  9. convertUNIXTimeToString(long time)