Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > creating Date objects

Reply
Thread Tools

creating Date objects

 
 
jimgardener
Guest
Posts: n/a
 
      06-11-2008
for running a sample program in sun's java tutorial(Employee program
in Comparators section of object ordering) i need to create some Date
objects with diff values for year ,month,day etc.Since Date(int year,
int month,int day) is deprecated i can't use new Date(2001,02,23) to
create a Date instance.How should i go about this?.can someone help?
jim
 
Reply With Quote
 
 
 
 
jimgardener
Guest
Posts: n/a
 
      06-11-2008
read the rest of the
> Javadoc for the deprecated constructor, the part that begins
> "replaced by ..."
>


sorry Eric...I need Date objects. i can't figure out how to get that
from a Calendar instance..
jim
 
Reply With Quote
 
 
 
 
jimgardener
Guest
Posts: n/a
 
      06-11-2008
read the rest of the
> Javadoc for the deprecated constructor, the part that begins
> "replaced by ..."


sorry about that..my mistakes!!shd have read carefully
jim
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-11-2008
On Wed, 11 Jun 2008 05:39:26 -0700 (PDT), jimgardener
<> wrote, quoted or indirectly quoted someone who
said :

>for running a sample program in sun's java tutorial(Employee program
>in Comparators section of object ordering) i need to create some Date
>objects with diff values for year ,month,day etc.Since Date(int year,
>int month,int day) is deprecated i can't use new Date(2001,02,23) to
>create a Date instance.How should i go about this?.can someone help?
>jim


Date itself is pretty well deprecated. The tutorial is probably old,
so just go ahead and use new Date.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      06-11-2008
In article
<cf7c4895-fc65-4e39-9fcc->,
jimgardener <> wrote:

> read the rest of the
> > Javadoc for the deprecated constructor, the part that begins
> > "replaced by ..."
> >

>
> sorry Eric...I need Date objects. i can't figure out how to get that
> from a Calendar instance..
> jim


Doesn't Calendar's getTime() return a Date?

"God marks time from the epoch; all else is the work of Sun." --with
apologies to Kronecker

John
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      06-17-2008
Roedy Green wrote:
> Date itself is pretty well deprecated. The tutorial is probably old,
> so just go ahead and use new Date.


Date is still absolutely necessary.

Only the stuff replaced by (Gregorian)Calendar is deprecated.

Arne
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating garbage collectable objects (caching objects) News123 Python 7 06-29-2009 04:12 PM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
asp.net date objects vs. classic asp date objects J. Muenchbourg ASP General 1 10-03-2003 06:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57