Here you can find the source of parseDateStrShort(String date)
public static Date parseDateStrShort(String date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final String DEFAULT_FORMAT = "EEE MMM dd HH:mm:ss z yyyy"; private static final SimpleDateFormat DF_SHORT = new SimpleDateFormat("yy MM dd"); public static Date parseDateStrShort(String date) { return parse(date, DF_SHORT); }// w w w. j ava 2 s .c o m /** * Parse to GMT date * @param time * @param df * @return */ public static Date parse(String time, SimpleDateFormat df) { return parse(time, df, null); } public static Date parse(String time, SimpleDateFormat df, TimeZone timeZone) { try { Date date = df.parse(time); if (timeZone != null) { date = fromLocalTZ(date, timeZone); } return date; } catch (ParseException e) { return null; } } /** * Parse to GMT date * @param time * @param df * @return */ public static Date parse(String time, String df) { return parse(time, df, null); } public static Date parse(String time, String df, TimeZone timeZone) { try { Date date = new SimpleDateFormat(df).parse(time); if (timeZone != null) { date = fromLocalTZ(date, timeZone); } return date; } catch (ParseException e) { return null; } } public static Date parse(String time, String[] dfs, TimeZone timeZone) { for (String df : dfs) { Date parse = parse(time, df, timeZone); if (parse != null) { return parse; } } return null; } public static Date parse(String dateStr) { return parse(dateStr, DEFAULT_FORMAT); } public static Date fromLocalTZ(Date time, TimeZone localTimeZone) { return new Date(time.getTime() - (localTimeZone.getRawOffset() - TimeZone.getDefault().getRawOffset())); } }