This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date class problems  RSS feed

 
Pedro Neves
Ranch Hand
Posts: 64
  • 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
Posts: 4181
22
IntelliJ IDE Java Python
  • Likes 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!