Here you can find the source of getYear(String date)
public static String getYear(String date)
//package com.java2s; //License from project: Open Source License public class Main { public static String getYear(String date) { return date.substring(6); }// w ww. j a va 2 s .c o m public static String substring(String input, int maxLength) { if (input == null) return null; else return (input.length()) <= maxLength ? input : input.substring(0, maxLength); } }