Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static int getDaysLeftInYear() { Calendar calendar = Calendar.getInstance(); return calendar.getActualMaximum(Calendar.DAY_OF_YEAR) - calendar.get(Calendar.DAY_OF_YEAR); } }