Java Year Get getYear()

Here you can find the source of getYear()

Description

get Year

License

Apache License

Declaration

public static String getYear() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getYear() {
        String str = "";
        final SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
        final Date date = new Date();
        str = sdf.format(date);/*from  w ww .jav a  2 s.  c om*/
        return str;
    }
}

Related

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