Here you can find the source of getCurrentYear()
public static int getCurrentYear()
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Google, Inc.//from w w w .j a v a 2 s .com * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Google, Inc. - initial API and implementation *******************************************************************************/ import java.util.Calendar; import java.util.GregorianCalendar; public class Main { /** * Answer the current year */ public static int getCurrentYear() { return (new GregorianCalendar()).get(Calendar.YEAR); } }