Android Long to Date Convert getTimeStringFrom(long timestamp)

Here you can find the source of getTimeStringFrom(long timestamp)

Description

get Time String From

Declaration

public static String getTimeStringFrom(long timestamp) 

Method Source Code

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

import java.util.Date;
import java.util.Locale;

public class Main {
    public static String getTimeStringFrom(long timestamp) {
        if (timestamp <= 0)
            return "";

        Date date = new Date(timestamp);
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm",
                Locale.getDefault());

        return formatter.format(date);
    }/*from w  w  w.  j a  v a2 s .  co m*/
}

Related

  1. formatTimeStampString(Context context, long when, boolean fullFormat)
  2. getDatesStartingFromToWithInterval( long startDate, long endDate, int dayInterval)
  3. getFormatDateString(String format, long date)
  4. getLongFriendlyDate(long timeInMillis)
  5. getShortFriendlyDate(long timeInMillis)
  6. humanFriendlyDate(long time)
  7. longToDate(long timestamp)
  8. millToDate(Long mill)
  9. toDateFromTimestamp(long date)