🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Generate Date

#7756
From: Florin Ciodaru
Date: Wed, 23 May 2001 06:25
34 lines
1867 bytes
Hi Russell,

you can use a GregorianCalendar and to hour or minute number an random
number :


Random r = Random();
GregorianCalendar cal = new GregorianCalendar();

int number = r.nextInt();
while(number>24 & number<24*30) number = r.nextInt();


cal.add(GregorianCalendar.HOUR, number);
Date date = cal.getTime();


"Russell" <weetat@cesmainternational.com> wrote in message
news:3B0B2D43.3D3B0294@cesmainternational.com...
>
>   Hi all  ,
>
>     I am using RedHat6.1 , jdk1.3 , postgresql and jbuilder3.5.
>     Currently , in my project , i need to generate dynamically date
> value on the my jsp in table format.
>     The Date generation is followed by parameter start date and end
> date.
>     for example ,
>            generateDate("04/04/2001","03/05/2001") method will generate
> date value from  4th of april to 3th of May 2001.
>
>
>
>     Anyway to do it in java ??  Thanks.
Technical Details
Message-ID: <3b0b5789_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3B0B2D43.3D3B0294@cesmainternational.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,ea3fae658d22c8d8
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-05-22 23:46:12 PST
From: "Florin Ciodaru" <florin@bluesoftware.ro>
Newsgroups: borland.public.jbuilder.java.language
References: <3B0B2D43.3D3B0294@cesmainternational.com>
Subject: Re: Generate Date 
Date: Wed, 23 May 2001 09:25:25 +0300
Lines: 36
Organization: Blue Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 194.153.242.163
Message-ID: <3b0b5789_1@dnews>
X-Trace: dnews 990599049 194.153.242.163 (22 May 2001 23:24:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews