Java Hour Format formatDateTime(Date date)

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

Description

format Date Time

License

Open Source License

Declaration

public static String formatDateTime(Date date) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static String formatDateTime(Date date) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return dateFormat.format(date);
    }//from   ww  w. j  av a2s. co m

    public static String format(Date date, String patten) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat(patten);
        return dateFormat.format(date);
    }
}

Related

  1. formatDateTime(Date date)
  2. formatDateTime(Date date)
  3. formatDateTime(Date date)
  4. formatDateTime(Date date)
  5. formatDateTime(Date date)
  6. formatDateTime(Date date)
  7. formatDateTime(Date date)
  8. formatDateTime(Date date)
  9. formatDateTime(Date date)