🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DateTime Functions

#18557
From: Michael J. Rozlog
Date: Wed, 10 Jun 1998 00:00
33 lines
1548 bytes
Dan:

I usually stay away from the methods of java.util.date, most of them
have been deprecated.  I use the Calendar which is an abstract class and
is implemented in other calendars like GregorianCalendar.  Here is an
example of how to use it, I hope this helps!

 
   java.util.Date d = new java.util.Date();
   GregorianCalendar gc = new GregorianCalendar();
   gc.setTime(d);
   hour = gc.get(Calendar.HOUR_OF_DAY);
   min = gc.get(Calendar.MINUTE);
   month = gc.get(Calendar.MONTH);

There is a complete list of constants like MINUTE, MONTH, HOUR_OF_DAY,
just look up Calendar for the whole list.

Mike


Dan Patterson wrote:
> 
> I am trying to do a really simply stringtodate conversion but am having no
> luck. I am using java.util.Date and have declared a Date variable. However
> any calls to getDate() for example do not work.
> 
> Please can someone help me as I am getting very frustrated with this.
> 
> Thanks in advance
> 
> Dan Patterson.
Technical Details
Message-ID: <357E7514.3449DAE5@email.msn.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6llgha$8lp4@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,54d6b77825cf9d6
X-Google-Attributes: gidf74b3,public
From: "Michael J. Rozlog" <rozm@email.msn.com>
Subject: Re: DateTime Functions
Date: 1998/06/10
Message-ID: <357E7514.3449DAE5@email.msn.com>
X-Deja-AN: 361341223
Content-Transfer-Encoding: 7bit
References: <6llgha$8lp4@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Reply-To: rozm@msn.com
Newsgroups: borland.public.jbuilder.java.language