Here you can find the source of parseDisplay4Key(Object date)
Parameter | Description |
---|---|
date | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static Object parseDisplay4Key(Object date) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat sdf4Key = new SimpleDateFormat("yyyyMMdd"); private static SimpleDateFormat sdf4Display = new SimpleDateFormat("dd/MM/yyyy"); /**//ww w . j a v a2 s . c o m * dd/MM/yyyy -> yyyyMMdd * * @param date * @return * @throws ParseException */ public static Object parseDisplay4Key(Object date) throws ParseException { return format4Key(sdf4Display.parse(date.toString())); } /** * yyyyMMdd * * @param date * @return */ public static String format4Key(Date date) { return sdf4Key.format(date); } }