tags:

views:

36

answers:

3

I want to have a property with the current time in a specific format: yyyyMMddhhmm . how can I do that in java ant build.xml?

+3  A: 

You can use the TStamp task

for example :

<tstamp>
    <format property="propertyName" pattern="yyyyMMddhhmm" />
</tstamp>
Colin Hebert
+4  A: 

You use the TStamp task.

<tstamp>
  <format property="TODAY"
          pattern="yyyyMMddhhmm"/>
</tstamp>
Banang
+1  A: 

found a solution:

<target name="timestamp2">
        <tstamp>
            <format property="current.time" pattern="yyyyMMd_hhmmss" />
        </tstamp>

        <echo message="current time: ${current.time}" />
</target>
ohadshai