Java SQL Date Parse parseDateYYMMddHHmmss1(Date date)

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

Description

Parse a java.sql.Date to String

License

Open Source License

Parameter

Parameter Description
ds a parameter

Exception

Parameter Description
ParseException an exception

Declaration

public static String parseDateYYMMddHHmmss1(Date date) throws ParseException 

Method Source Code


//package com.java2s;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    public final static String DATE_FORMAT_yyMMddHHmmss = "yyMMddHHmmss";

    /**/*from   w  w w  .j  a  v a  2 s .  co  m*/
     * Parse a java.sql.Date to String
     * 
     * @param ds
     * @return
     * @throws ParseException
     */
    public static String parseDateYYMMddHHmmss1(Date date) throws ParseException {
        return new SimpleDateFormat(DATE_FORMAT_yyMMddHHmmss).format(date);
    }

    public static String parseDateYYMMddHHmmss1(java.util.Date date) throws ParseException {
        return new SimpleDateFormat(DATE_FORMAT_yyMMddHHmmss).format(date);
    }

    public static java.util.Date parseDateYYMMddHHmmss1(String ds) throws ParseException {
        return new Date(new SimpleDateFormat(DATE_FORMAT_yyMMddHHmmss).parse(ds).getTime());
    }
}

Related

  1. parseDate(String value, String format)
  2. parseDate2(Date date, String pattern)
  3. parseDateE(Date dt)
  4. parseDateString(String tmp, String format)
  5. parseDateYYMMddHHmm(java.util.Date date)
  6. parseDateyyyy_MM_DD(String ds)
  7. parseSqlDate(final String value)
  8. parseSqlDate(final String value)
  9. parseSqlDate(java.util.Date date)