Java Year Get getYear(String day)

Here you can find the source of getYear(String day)

Description

get Year

License

Apache License

Declaration

public static int getYear(String day) 

Method Source Code

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

public class Main {

    public static int getYear(String day) {
        if (day == null)
            return 0;
        if (day.length() < 8)
            return 0;
        return Integer.parseInt(day.substring(0, 4));
    }/* w ww.ja v  a  2 s. c  o  m*/
}

Related

  1. getYear(String date)
  2. getYear(String date)
  3. getYear(String date)
  4. getYear(String dateKey)
  5. getYear(String datetime)
  6. getYear(String index)
  7. getYear(String referralId)
  8. getYear(String startTime)
  9. getYear(String str_date)