aspose file tools*
The moose likes Java in General and the fly likes Calculate Fiscal year Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Calculate Fiscal year" Watch "Calculate Fiscal year" New topic
Author

Calculate Fiscal year

Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 290

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


OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Sounds like you need to implement your own Calendar class.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
bart zagers
Ranch Hand

Joined: Feb 05, 2003
Posts: 234
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

Joined: Oct 03, 2006
Posts: 18
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.


'allo Poppet!!!
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calculate Fiscal year