Java Time Format getFormattedCurrentDateAndTime()

Here you can find the source of getFormattedCurrentDateAndTime()

Description

get Formatted Current Date And Time

License

Apache License

Declaration

public static String getFormattedCurrentDateAndTime() 

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 getFormattedCurrentDateAndTime() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date(System.currentTimeMillis());
        return formatter.format(date);
    }/*from   w ww.j a  v  a 2s.  c  om*/
}

Related

  1. getFormatDate(String timeString, String format)
  2. getFormatDatetime()
  3. getFormatDateTime(Date date)
  4. getFormatDateTime(Date date, String format)
  5. getFormatDateTime(java.util.Date date)
  6. getFormattedCurrentDateTime(String pattern)
  7. getFormattedDateAndTime(final Date date)
  8. getFormattedDateTime(Date date, String pattern)
  9. getFormattedDateTime(String date, String dateFormat)