Java Parse Date Pattern YYYY parseToString(Date date)

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

Description

parse To String

License

Apache License

Declaration

public static String parseToString(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

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

    public static String parseToString(Date date) {
        return parseToString(date, yyyyMMddHHmmss);
    }/*w  w w  . j av a  2 s .co m*/

    public static String parseToString(Date date, String style) {
        if (date == null)
            return null;

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(style);
        return simpleDateFormat.format(date);
    }
}

Related

  1. parseToDate(String date)
  2. parseToDate(String date, String format)
  3. parseToDateLenient(final String date, final String format, final boolean lenient)
  4. parseToGregorianCalendar(String dateString)
  5. parseToRegExcel(String raw)
  6. parseToString(Date date, String format)
  7. parseToString(final Date date, final String format)
  8. parseToStringDate(long ms)
  9. parseTwitterDate(String theDate)