开发者

how to set time property in ant

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?


You use the TStamp task.

<tstamp>
  <format property="TODAY"
          pattern="yyyyMMddhhmm"/>
</tstamp>


You can use the TStamp task

for example :

<tstamp>
    <format property="propertyName" pattern="yyyyMMddhhmm" />
</tstamp>


found a solution:

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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜