Okay.. Nu kan jeg da kompilere programmet igen..
Koden:
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT+1"), new Locale("da"));
Calendar h = Calendar.getInstance(TimeZone.getTimeZone("GMT+1"), new Locale("da"));
int d, e, jul, nyt;
d = c.get(Calendar.DAY_OF_MONTH);
e = h.get(Calendar.DAY_OF_WEEK);
jul = 24 - d;
nyt = 31 - d;
Men mit output ser bare bare lidt sjov ud:
I dag er detjava.util.GregorianCalendar[time=1166560203328,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+01:00",offset=3600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2006,MONTH=11,WEEK_OF_YEAR=51,WEEK_OF_MONTH=3,DAY_OF_MONTH=19,DAY_OF_YEAR=353,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=9,HOUR_OF_DAY=21,MINUTE=30,SECOND=3,MILLISECOND=328,ZONE_OFFSET=3600000,DST_OFFSET=0] d. 19 december.
I dag er der 5 dage til juleaften.
Hvad gør jeg galt?
Indlæg senest redigeret d. 19.12.2006 21:34 af Bruger #11033