Java Day getDaysforYear()

Here you can find the source of getDaysforYear()

Description

get Daysfor Year

License

Apache License

Declaration

public static long getDaysforYear() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static long getDaysforYear() {
        Date d = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        int year = Integer.valueOf(sdf.format(d).substring(0, 4));
        long count = (year % 400 == 0) || (year % 100 != 0) && (year % 4 == 0) ? 366 : 365;
        return count;
    }/*from  ww  w.jav  a2s . com*/
}

Related

  1. getDays(Date sd, Date ed)
  2. getDays(String yyyy)
  3. getDaysAgo(int interval)
  4. getDaysByYearMonth(String ym)
  5. getDaysForDate(String date)
  6. getDaysFrom2Dates(Calendar calendar1, Calendar calendar2)
  7. getDaysLater(int day)
  8. getDaysMonthYear(Date date)
  9. getDaysOfDates(Date first, Date second)