Article View: borland.public.jbuilder.java.language
Article #8035Re: time and date classes
From: John McGrath TeamB
Date: Sat, 28 Apr 2001 11:38
Date: Sat, 28 Apr 2001 11:38
23 lines
1687 bytes
1687 bytes
On Fri, 27 Apr 2001 15:55:29 -0400, Dave Cullen wrote:
> But how do I get a GregorianCalendar object to update?
> Seems that myCalendar.get(Calendar.SECONDS) only returns
> the value at the moment that the object was created.
The only way to update them is to call their methods that change their
values. Dates and Calendars do not especially represent the current
moment in time, and they do not update themselves. The default value
for Date and Calendar objects is the current time.
If you want the current time, you can use the value returned from
System.currentTimeMillis() to set it. You could also just construct a
new Date or Calendar object.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.15546cb5909511d398a154@forums.borland.com>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!193.251.151.101!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ae9bac9$1_1@dnews> <3ae9cd82_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,bbd9694ac963e101 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-28 04:44:25 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.language Subject: Re: time and date classes Date: Sat, 28 Apr 2001 07:38:14 -0400 Message-ID: <MPG.15546cb5909511d398a154@forums.borland.com> References: <3ae9bac9$1_1@dnews> <3ae9cd82_1@dnews> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 988457893 209.92.40.60 (28 Apr 2001 04:38:13 -0700) Lines: 23 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!193.251.151.101!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews