Java Year Get GetYear(String agmipDate)

Here you can find the source of GetYear(String agmipDate)

Description

Get Year

License

Open Source License

Declaration

public static String GetYear(String agmipDate) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static final SimpleDateFormat apsim = new SimpleDateFormat("dd/MM/yyyy");

    public static String GetYear(String agmipDate) throws ParseException {
        Date date = apsim.parse(agmipDate);
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*  w ww.ja v  a 2 s.  c  o m*/
        return c.get(Calendar.YEAR) + "";
    }
}

Related

  1. getYear(final String date)
  2. getYear(final String date)
  3. getYear(int year)
  4. getYear(long date)
  5. getYear(String aDate)
  6. getYear(String argDate)
  7. getYear(String date)
  8. getYear(String date)
  9. getYear(String date)