aspose file tools*
The moose likes Beginning Java and the fly likes Date class problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Date class problems" Watch "Date class problems" New topic
Author

Date class problems

Pedro Neves
Ranch Hand

Joined: Mar 07, 2012
Posts: 64
Hello, well i'm having some trouble with the date class:







I guess this is allright but then the output is:

####### day = 19
%%%%%%% day = 0

:S Can somebody help please?

Kind regards
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Pedro Neves wrote:I guess this is allright but then the output is:

####### day = 19
%%%%%%% day = 0

:S Can somebody help please?


First: You should read the API for the java.util.Date (<- click) so you can see what it does. Once you do that you should realize why the returned value is zero. You should also understand that the Date#getDate() method is deprecated and an alternative should be used (see that API for the alternative to use).


Steve
Pedro Neves
Ranch Hand

Joined: Mar 07, 2012
Posts: 64
Steve Luke wrote:
Pedro Neves wrote:I guess this is allright but then the output is:

####### day = 19
%%%%%%% day = 0

:S Can somebody help please?


First: You should read the API for the java.util.Date (<- click) so you can see what it does. Once you do that you should realize why the returned value is zero. You should also understand that the Date#getDate() method is deprecated and an alternative should be used (see that API for the alternative to use).


Many thanks.. I already has managed it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date class problems