Java Date to String datetime(Date date)

Here you can find the source of datetime(Date date)

Description

datetime

License

Apache License

Declaration

public static String datetime(Date date) 

Method Source Code


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

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String datetime(Date date) {
        return formatter.format(date);
    }/*from w  w w  .jav  a  2  s  .c om*/
}

Related

  1. date2String2(Date date)
  2. date2StringISO(Date date)
  3. date2StringMD(Date date)
  4. date2StringPattern(Date value, String pattern)
  5. Date2StringSec(Date date)
  6. dateTime2String(Date dateTime, DateFormat dateFormat)
  7. dateTimeISO(final java.util.Date date)
  8. dateTimeToZero(Date date)
  9. dateTo14String(Date date)