Android Date Time Get getCurrentDate(String time)

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

Description

get Current Date

Declaration

public static String getCurrentDate(String 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  a  2  s .c om
        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(long time)
  4. getDatetime()
  5. isNight()
  6. getDateDifference(Date thenDate)