Java Year Get getYear()

Here you can find the source of getYear()

Description

get Year

License

Open Source License

Declaration

public static String getYear() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private final static SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");

    public static String getYear() {
        return sdfYear.format(new Date());
    }//from   w w w. j ava  2  s .co  m
}

Related

  1. getThisYear()
  2. getTwoDigitYear()
  3. getTwoYearsBefore(int date)
  4. getWeekOfYear(Date date)
  5. getWeekStartEndDate(int timeInfo, String yearInfo)
  6. getYear()
  7. getYear()
  8. getYear()
  9. getYear()