Android Time Get getCurrentDateTime()

Here you can find the source of getCurrentDateTime()

Description

get Current Date Time

License

Apache License

Declaration

public static String getCurrentDateTime() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getCurrentDateTime() {
        return getFormatDateTime(new Date(), "yyyy-MM-dd HH:mm:ss");
    }/* w  ww .  ja v a2  s .  c  om*/

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

Related

  1. toTime(int time)
  2. getCurrentTime()
  3. intConvertTime(int hour, int minut)
  4. getCurrentTime(String format)
  5. getCurrentTimeString()
  6. getCurrentTime()
  7. getFormatShortTime(Date date)
  8. getFormatTime(Date date)
  9. getCurTimeByFormat(String format)