check date for variable value

Posted by Leslie on Stack Overflow See other posts from Stack Overflow or by Leslie
Published on 2010-03-31T15:53:09Z Indexed on 2010/03/31 18:13 UTC
Read the original article Hit count: 339

Filed under:
|
|

I have a variable in my Java class that needs to be set based on whether today is before or after 7/1. If today is before 7/1 then we are in fiscal year that is the current year (so today we are in FY10). If today is after 7/1 our new fiscal year has started and the variable needs to be the next year (so FY11).

psuedo code:

if today < 7/1/anyyear then
  BudgetCode = "1" + thisYear(YY)  //variable will be 110
else
  BudgetCode = "1" + nextYear(YY)  //variable will be 111

thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about date