/** * Formats the specific date into the given pattern * * @param pattern date pattern * @param date date to be formatted * @return formated string representing the give date */ public static String format(String pattern, Date date) { return getSimpleDateFormat(pattern).get().format(date); }
/** * Parses the specified date string with the given date pattern and returns * the Date object. * * @param pattern date pattern * @param dateString The date string to parse. * @return The parsed Date object. */ public static Date parse(String pattern, String dateString) { try { return getSimpleDateFormat(pattern).get().parse(dateString); } catch (final ParseException pe) { throw new IllegalArgumentException(pe); } }
/** * Formats the specific date into the given pattern * * @param pattern date pattern * @param date date to be formatted * @return formated string representing the give date */ public static String format(String pattern, Date date) { return getSimpleDateFormat(pattern).get().format(date); }
/** * Formats the specific date into the given pattern * * @param pattern date pattern * @param date date to be formatted * @return formated string representing the give date */ public static String format(String pattern, Date date) { return getSimpleDateFormat(pattern).get().format(date); }
/** * Parses the specified date string with the given date pattern and returns * the Date object. * * @param pattern date pattern * @param dateString The date string to parse. * @return The parsed Date object. */ public static Date parse(String pattern, String dateString) { try { return getSimpleDateFormat(pattern).get().parse(dateString); } catch (final ParseException pe) { throw new IllegalArgumentException(pe); } }
/** * Parses the specified date string with the given date pattern and returns * the Date object. * * @param pattern date pattern * @param dateString The date string to parse. * @return The parsed Date object. */ public static Date parse(String pattern, String dateString) { try { return getSimpleDateFormat(pattern).get().parse(dateString); } catch (final ParseException pe) { throw new IllegalArgumentException(pe); } }