Android Long to Date Convert getDate(long timeStamp)

Here you can find the source of getDate(long timeStamp)

Description

get Date

Declaration

@SuppressLint("SimpleDateFormat")
    public static String getDate(long timeStamp) 

Method Source Code

//package com.java2s;
import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    @SuppressLint("SimpleDateFormat")
    public static String getDate(long timeStamp) {
        try {//from  w  w  w. j  a v a2 s.  c o m
            SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy");
            Date netDate = (new Date(timeStamp));
            return sdf.format(netDate);
        } catch (Exception ex) {
            return "";
        }
    }
}

Related

  1. getLabelForEventInTime(long inTime)
  2. getTimeDelta(long delta, String dateFormat)
  3. timeAgo(long aTime)
  4. isTomorrow(long lTime)
  5. getActivityTime(long startTime, long endTime)
  6. getDateFrom(long timestamp, Context context)
  7. getDateFromLong(long dateLong)
  8. getDateTimeString(long time_milis)
  9. formatTime(long timeInMillis)