开发者

how to set time property in ant

开发者 https://www.devze.com 2023-01-19 14:53 出处:网络
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.

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

精彩评论

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