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

Calculate Fiscal year

 
Aryan Khan
Ranch Hand
Posts: 290
Java Oracle Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to set the start of year to a different date than 01/01/.
Lets say I want to set the start date of the year to 23-02.
I want the java calendar classes to return the fields e.g week days, month etc according to this new date.for example Calendar.get(Calendar.MONTH)) for above date should return 0 as it is the first month of my fiscal year.

Is there any way to set this?

Thanks
Ahmad
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need to implement your own Calendar class.
 
bart zagers
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:
Sounds like you need to implement your own Calendar class.


Sounds like you should take a look at Joda-Time, to see how it can help you.
 
Casey Buresh
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you doing this for? Why not just use Math.random() to random numbers between 1 and 12 then have if else statements to set it so like if it comes up with 2 then the second Math.random() is only going to go between 1 and 28 or however many days there are in February. Unless you need to set something as a new date permanentaly then just do what others said.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if packages like Time And Money or Joda Time do what you need. Or just google for Java Fiscal Year and see what pops up.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic