Here you can find the source of parseDateYYMMddHHmmss1(Date date)
Parameter | Description |
---|---|
ds | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static String parseDateYYMMddHHmmss1(Date date) throws ParseException
//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()); } }