Article View: borland.public.jbuilder.java.language
Article #8333Re: Calcs with date
From: icsd.jt
Date: Sat, 31 Mar 2001 09:28
Date: Sat, 31 Mar 2001 09:28
35 lines
2116 bytes
2116 bytes
OK I go at once to try Thank, Jacques "John McGrath [TeamB]" <ng-b@JPMcGrath.net> a οΏ½crit dans le message news: MPG.152f440031c959298a0de@forums.borland.com... > On Fri, 30 Mar 2001 09:18:56 +0200, icsd.jt@wanadoo.fr wrote: > > > From a date I want to calc the date of the 5 next days : > > Madate + 1, Madate +2 ... > > I think It was simple but with class Date and/or GregorianCalendar, > > add() or madate + x .. are not accepted (Method not found.. with the > > imports java.util.GregorianCalendar,java.util.calendar and java.util.date > > or run bad : the give me the same date to 01/01/70 ) > > With a Date object, you could get the "time" value, which is in > milliseconds since the epoch, and add the number of milliseconds in a > day to it. For example: > > static final int MILLISECONDS_PER_DAY = 1000 * 60 * 60 * 24; > : > date.setTime( date.getTime() + MILLISECONDS_PER_DAY ); > > With a Calendar object, you can use the add() method: > > calendar.add( Calendar.DATE, 1 ); > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3ac5a319_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!193.252.62.57References:
<3ac4333b_1@dnews> <MPG.152f440031c959298a0de@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,c3bf18884d79d144 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-31 01:44:02 PST Reply-To: <icsd.jt@wanadoo.fr> From: <icsd.jt@wanadoo.fr> Newsgroups: borland.public.jbuilder.java.language References: <3ac4333b_1@dnews> <MPG.152f440031c959298a0de@forums.borland.com> Subject: Re: Calcs with date Date: Sat, 31 Mar 2001 11:28:29 +0200 Lines: 37 Organization: ICSD - JaC X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 193.252.62.57 Message-ID: <3ac5a319_1@dnews> X-Trace: 31 Mar 2001 01:27:53 -0800, 193.252.62.57 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!193.252.62.57