List of utility methods to do Year Get
int | getYear(String date) Get year return Integer.parseInt(date.substring(0, 4));
|
String | getYear(String date) get Year return date.substring(6);
|
int | getYear(String dateKey) Get the year of the date key. return Integer.valueOf(dateKey.substring(0, 4));
|
int | getYear(String datetime) get Year Calendar cal = Calendar.getInstance();
cal.setTime(parseDate(datetime));
return cal.get(Calendar.YEAR);
|
int | getYear(String day) get Year if (day == null) return 0; if (day.length() < 8) return 0; return Integer.parseInt(day.substring(0, 4)); |
int | getYear(String index) get Year String[] dateTmp = index.split("-"); return Integer.parseInt(dateTmp[1]); |
String | getYear(String referralId) Get the full year from the referral id. return "20" + parse(referralId)[2]; |
int | getYear(String startTime) get Year int year = 0; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); try { year = sdf.parse(startTime).getYear() + 1900; } catch (Exception ex) { ex.printStackTrace(); return year; ... |
String | getYear(String str_date) get Year return getYear(str_date, "-"); |
int | getYear(String strDate) get Year Calendar cale = toCalendar(strDate); if (cale == null) { return -1; return cale.get(Calendar.YEAR); |