Android Long to Date Convert GetDate(long milliseconds)

Here you can find the source of GetDate(long milliseconds)

Description

Get Date

Declaration

public static Date GetDate(long milliseconds) 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date GetDate(long milliseconds) {
        return new Date(milliseconds);
    }//  ww w  .j a v a  2s.  c  om

    public static Date GetDate(String time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        try {
            return sdf.parse(time);
        } catch (ParseException e) {
            return new Date();
            // e.printStackTrace();
        }
    }
}

Related

  1. convToEnglishTime(long dateMsec)
  2. converTime(long timestamp, String[] timeLabels)
  3. convertNotNull(Long long1)
  4. convertToDateStamp(long time)