Java Year Get currentYear()

Here you can find the source of currentYear()

Description

current Year

License

LGPL

Declaration

public static String currentYear() 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static SimpleDateFormat formatter;

    public static String currentYear() {

        formatter = new SimpleDateFormat("yyyy");
        return formatter.format(new Date());
    }//  w w w . j  ava  2  s .  c om
}

Related

  1. calcDifferenceAsYears(Calendar aBaseDate, Calendar aTargetDate)
  2. currentYear()
  3. currentYearStr()
  4. getBeforeYear()
  5. getBeginningOfYear()
  6. getCalendarYearString(Calendar date)