Android Date to String Convert getCurrentTimeStr()

Here you can find the source of getCurrentTimeStr()

Description

get Current Time Str

Declaration

public static String getCurrentTimeStr() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public static String getCurrentTimeStr() {
        SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
        Date d = new Date(System.currentTimeMillis());
        return dateFormat.format(d);
    }/* w  w  w  .j a v  a  2s .c  om*/
}

Related

  1. formatDate(Date date, String format)
  2. formatDate(String format, Date date)
  3. formatDate(final Date date)
  4. getCurrentDateStr()
  5. getCurrentDateStrs()
  6. getDateByFormatedString(String date)
  7. getDateTimeString(Date date)
  8. getDateTimeString(Date date, int format, Locale currentLocale)
  9. getFileName()