Android Date Time Get 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  .  jav a2 s.co  m
        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. getCurDateTime()
  2. getCurDateTime(String pattern)
  3. getCurrentDate(String time)
  4. getDatetime()
  5. isNight()
  6. getDateDifference(Date thenDate)
  7. currentTimeLabel()