Two Laptop Bag*
The moose likes Cattle Drive and the fly likes Geek Watch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Geek Watch" Watch "Geek Watch" New topic
Author

Geek Watch

sumant suri
Greenhorn

Joined: May 24, 2001
Posts: 8
i have been trying to work this assignemt out for the past few days, but i just cant get it to work. I think part of myproblem is that i dont know how to use the Date Class.
here is the code i have:

Please do not post your code. You can post snippets or pseudocode instead. -- Marilyn

[This message has been edited by Marilyn deQueiroz (edited June 02, 2001).]
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
One of the Date methods gives you the number of milliseconds since January 1, 1970. From there you do the old how many seconds make a minute, how many minutes make a hour, how many hours make a day type math to figure out the number of seconds and days. Also you don't need to use any of the deprecated Date methods.
Hope this helps.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
Rather than trying to put the date into the Date constructor, you should use the parameters from the command line for your calculations. Instantiate Date. Then you can do your calculations (using methods from the Date class) using those parameters and the Date object you have instantiated.

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Sayed Ibrahim Hashimi
Ranch Hand

Joined: May 17, 2001
Posts: 148
A quick question: Why did you say that we can't post code?
Did he/she post a lot?
Originally posted by Marilyn deQueiroz:
Rather than trying to put the date into the Date constructor, you should use the parameters from the command line for your calculations. Instantiate Date. Then you can do your calculations (using methods from the Date class) using those parameters and the Date object you have instantiated.


SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
Originally posted by Ibrahim Hashimi:
A quick question: Why did you say that we can't post code?
Did he/she post a lot?

Sumant Suri posted his/her entire solution. I removed most of the code and replaced it with "// stuff".

Usually I prefer that you don't post code here. If you post great code, you will be robbing others of an education.


[This message has been edited by Marilyn deQueiroz (edited June 02, 2001).]
sumant suri
Greenhorn

Joined: May 24, 2001
Posts: 8
sorry abt posting code. DId'nt know u'r policy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Geek Watch
 
Similar Threads
static method overriden?
operators
Regarding static blocks
email methods?
inheritance