View Single Post
  #1 (permalink)  
Old 07-23-2007, 08:30 PM
osval osval is offline
Member
 
Join Date: Jul 2007
Posts: 26
osval is on a distinguished road
Help with gregorian calendar
I'm trying to calculate how many days left in the year but it doesn't work

this is my code:
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
Reply With Quote
Sponsored Links