I'm trying to calculate how many days left in the year but it doesn't work
this is my code:
public class Calculate
{
public static void main (String args[])
{
GregorianCalendar today = new GregorianCalendar();
GregorianCalendar nyear = new GregorianCalendar(365,12,31);
long daysleft= nyear .get(nyear .DAY_OF_YEAR) - today.get(today.DAY_OF_YEAR);
System.out.println( daysleft);
}
}
thanks