Android Date Format getCurrentTime()

Here you can find the source of getCurrentTime()

Description

get Current Time

Declaration

public static String getCurrentTime() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentTime() {
        return getFormatDateTime(new Date(), "yyyy-MM-dd HH:mm:ss");
    }//from   w  ww  . j  a  va 2s  . c om

    public static String getFormatDateTime(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

Related

  1. getCurrentDateTime()
  2. getCurrentDay()
  3. getCurrentDayOfWeek()
  4. getCurrentFormatedDate()
  5. getCurrentMonth()
  6. getCurrentYear()
  7. getDateEN()
  8. getDefaultFormatter(Date date)
  9. getFormatCurrentAdd(int amount, String format)