Android Long to Date Convert getCurrentDate(long time)

Here you can find the source of getCurrentDate(long time)

Description

get Current Date

Declaration

public static String getCurrentDate(long time) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Locale;

public class Main {

    public static String getCurrentDate(long time) {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd",
                Locale.CHINA);/*from w w  w  .ja  v a 2  s.com*/
        return dateFormat.format(time);
    }

    public static String getCurrentDate(String time) {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd",
                Locale.CHINA);
        return dateFormat.format(Long.valueOf(time));
    }
}

Related

  1. getDateFrom(long timestamp, Context context)
  2. getDateFromLong(long dateLong)
  3. getDateTimeString(long time_milis)
  4. formatTime(long timeInMillis)
  5. formatDate(long timeInMillis)
  6. changeMillisToFormat(long milliseconds, String pattern)
  7. convertLongToDateString(long mills, String format)
  8. format(String pattern, long timeInMillis)
  9. formatDateD(Context paramContext, long paramLong)