Here you can find the source of getYear(String day)
public static int getYear(String day)
//package com.java2s; //License from project: Apache License public class Main { public static int getYear(String day) { if (day == null) return 0; if (day.length() < 8) return 0; return Integer.parseInt(day.substring(0, 4)); }/* w ww.ja v a 2 s. c o m*/ }