List of utility methods to do Year Format
int | getYear(String pFormattedDate) get Year StringTokenizer vSt = new StringTokenizer(pFormattedDate, "-"); int val = Integer.parseInt(vSt.nextToken()); return val; |
String | getYYMMDD() get YYMMDD Date d = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd"); return sdf.format(d); |
String | getYYMMDD(int i) get YYMMDD Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.HOUR, i); date = cal.getTime(); SimpleDateFormat df = new SimpleDateFormat("yyMMdd:hhmm"); return df.format(date); |
String | getYYYY() get YYYY return formatterYYYY.format(Calendar.getInstance().getTime());
|
String | getYYYY(java.util.Date date) get YYYY if (date == null) return ""; return yyyy.format(date); |
String | getyyyy_MM_dd(Date date) getyyyMdd if (date == null) return ""; return sdf.format(date); |
String | getyyyy_MM_dd2(String date) getyyyMdd if (date == null) return ""; return sdf.format(sdf.parse(date)); |
SimpleDateFormat | getYYYYMM() get YYYYMM SimpleDateFormat yyyymm = new SimpleDateFormat("yyyyMM"); return yyyymm; |
String | getYYYYMM(final Date date, final String separator) Returns the date as month/day/year with the supplied separator. SimpleDateFormat format = new SimpleDateFormat("yyyy" + separator + "MM"); return format.format(date); |
String | getYYYYMMDD(Date date) get YYYYMMDD SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); return sdf.format(date); |