Java Year Get getYear()

Here you can find the source of getYear()

Description

get Year

License

Apache License

Declaration

public static String getYear() throws ParseException 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {

    public static String getYear() throws ParseException {
        Date date = new Date();
        SimpleDateFormat formatter;
        String pattern = "yyyy";
        formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA"));

        return formatter.format(date);
    }/*from w ww . j  av a 2s .c  om*/
}

Related

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