Java Utililty Methods Year From

List of utility methods to do Year From

Description

The list of methods to do Year From are organized into topic(s).

Method

StringyearformMatDate(Date date)
yearform Mat Date
return sydf.format(date);
StringyearFromDate(String date)
year From Date
String dt = date.substring(0, 4);
return dt;
intyearFromDateValue(long x)
Get the year from a date value.
return (int) (x >>> SHIFT_YEAR);
intyearFromFileName(String str)
Filename Eg : en.13.3.1.2009.6.11
try {
    return Integer.parseInt(str.split("\\.")[4]);
} catch (ArrayIndexOutOfBoundsException e) {
    return -1;
intyearOfDate(Date s)
year Of Date
String d = FORMAT_YYYY_MM_DD.format(s);
return Integer.parseInt(d.substring(0, 4));
intyearsBetween(String from, String to)
years Between
return yearsBetween(from, to, "yyyyMMdd");