Java Parse Date parseDateToString(Date datetime)

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

Description

parse Date To String

License

Open Source License

Declaration

public static String parseDateToString(Date datetime) 

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 String parseDateToString(Date datetime) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        java.util.Date sDate = new java.util.Date(datetime.getTime());
        return df.format(sDate);
    }//  w w  w.j a v  a  2 s  . co  m
}

Related

  1. parseDateTimeString(String dateTime)
  2. parseDateTimeString(String dateTimeString)
  3. parseDateToStr(Date date)
  4. parseDateToString(Date date, String format)
  5. parseDateToString(Date date, String pattern)
  6. parseDateToString(final Date date, final String dateFormat, final String lang)
  7. parseDateValue(String value)
  8. parseDateWithFormat(String date, SimpleDateFormat dateFormat, Date defaultDate)
  9. parseDateWithLeniency(final String str, final Locale locale, final String[] parsePatterns, final boolean lenient)