🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8231

Very simple question about date

#8231
From: Russell
Date: Mon, 16 Apr 2001 05:52
34 lines
1878 bytes
 
  Hi all , 

   I am using RedHat6.1 , jdk1.3 and jbuilder3.5. Below is my code:
   
     Calendar cal = Calendar.getInstance();
     Date startdt = cal.getTime();
     System.out.println(startdt.toString());
     System.out.println(cal.get(Calendar.MONTH));
     System.out.println(cal.get(Calendar.DAY_OF_WEEK));
     System.out.println(cal.get(Calendar.DAY_OF_MONTH));

     int start = cal.get(Calendar.DAY_OF_MONTH);

     cal.set(2001,4,20);
     Date enddt = cal.getTime();
     System.out.println(enddt.toString());
     System.out.println(cal.get(Calendar.MONTH));
     System.out.println(cal.get(Calendar.DAY_OF_MONTH));
     int end = cal.get(Calendar.DAY_OF_MONTH);


     // month april
     for(int i = start ; i < 31 ; i++){
      System.out.println("i " + i);
     }

     // month may
     for(int j = 1 ; j < end ; j++){
       System.out.println("j" + j);
     }

   I want to combine the two "for" loops into one loops only , anybody
have any ideas ?? Thanks.
Technical Details
Message-ID: <3ADA8885.92151876@cesma.com.sg>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!newsfeed.gamma.ru!Gamma.RU!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,6cf9ff513c886017,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-04-15 23:14:03 PST
Message-ID: <3ADA8885.92151876@cesma.com.sg>
Date: Mon, 16 Apr 2001 13:52:05 +0800
From: Russell <weetat@cesma.com.sg>
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.13-0.13 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Very simple question about date
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.126.155.39
X-Trace: dnews 987399764 203.126.155.39 (15 Apr 2001 22:42:44 -0700)
Lines: 34
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!newsfeed.gamma.ru!Gamma.RU!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews