Here you can find the source of getYearNumberofdays(String date)
public static int getYearNumberofdays(String date)
//package com.java2s; public class Main { public static int getYearNumberofdays(String date) { int year = Integer.parseInt(date.split("-")[0]); if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { return 366; }//w w w . j a v a2 s . c o m return 365; } }