ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Adding a year to tstamp date
Date Fri, 09 Feb 2007 14:40:47 GMT
I have a need to set the value of a property to the current fiscal year. For this purpose,
that means that when running a build in October, November, or December, the value must be
the current year +1. In any other month, the value is the same as the current year.

I thought something like this would do the trick:
I set the value of ${MON} manually to "10" for testing purposes.

<property name="MON" value="10" />

<switch value="${MON}">
  <case value="10">
      <format property="current.fy" pattern="yyyy" offset="1" />
  <case value="11">
      <format property="current.fy" pattern="yyyy" offset="1" />
  <case value="12">
      <format property="current.fy" pattern="yyyy" offset="1" />
  <default><property name="current.fy" value="${YEAR}" /></default>

But the offset isn't applied. When I <echo>${current.fy}</echo> I get "2007".

Can someone offer me a solution to this?


Charles Knell - email

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message