Java Year Current getCurrentYear()

Here you can find the source of getCurrentYear()

Description

Answer the current year

License

Open Source License

Declaration

public static int getCurrentYear() 

Method Source Code

//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);
    }
}

Related

  1. getCurrentYear()
  2. getCurrentYear()
  3. getCurrentYear()
  4. getCurrentYear()
  5. getCurrentYear()
  6. getCurrentYear()
  7. getCurrentYear()
  8. getCurrentYearFirst()
  9. getCurrentYearMonth()