Here you can find the source of getCurrentYear()
public static String getCurrentYear()
//package com.java2s; /*//from ww w.jav a2s . co m * @(#)ConversionUtil.java * * Copyright by ObjectFrontier, Inc., * 12225 Broadleaf Lane, Alpharetta, GA 30005, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of ObjectFrontier, Inc. You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of * the license agreement you entered into with ObjectFrontier. */ public class Main { /** * This method should return the current year * * @return string */ public static String getCurrentYear() { java.sql.Date date = new java.sql.Date(System.currentTimeMillis()); java.text.SimpleDateFormat out = new java.text.SimpleDateFormat("yyyymmdd"); return out.format(date).substring(0, 4); } }