This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date class problems

 
Pedro Neves
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Pedro Neves
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic