Java Hour Format formatToString(Date date)

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

Description

format To String

License

Open Source License

Declaration

public static String formatToString(Date date) 

Method Source Code

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

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

public class Main {
    public static final String FROMAT = "yyyy-MM-dd HH:mm:ss";

    public static String formatToString(Date date) {
        String time = null;//w  w w .j  a  va  2 s .c o m
        SimpleDateFormat format = new SimpleDateFormat(FROMAT);
        time = format.format(date);

        return time;
    }
}

Related

  1. formatTime_1(long time_value)
  2. formatTime_2(long time_value, long frame_rate)
  3. formatToHour(Date date)
  4. formatToOpenMrsDate(Date date)
  5. formatToSec(Date date)
  6. formatUIDate(Calendar calendar)
  7. formatUnixFileListing(final Date d)
  8. formatUnsignedVersion(String ver)
  9. formatValue(Object value)