ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sujan Digumarti <Sujan.Diguma...@india.techspan.com>
Subject RE: propertyfile task returning wrong date
Date Fri, 03 May 2002 12:29:59 GMT
<tstamp>
  <format property="BUILD_DATE" pattern="yyyyMMd" /> 
</tstamp>
change BUILD_DATE to builddate

-----Original Message-----
From: Nolan Ring [mailto:Nolan.Ring@Sun.Com]
Sent: Friday, May 03, 2002 5:57 PM
To: 'ant-user@jakarta.apache.org'
Subject: propertyfile task returning wrong date




Hi,

The following is a snippet of my build.xml file in which I capture build
number and date in order
to create a build label.  It works great except for the fact that the date
it returns is Jan 1, 1970! :-)

build.xml file:

<propertyfile file="buildversion.properties" comment="Date, time and build
number of most recent build"> 
<entry key="buildnum" type="int" default="0000" operation="+" pattern="0000"
/> 
<entry key="builddate" type="date" default="now" pattern="yyyyMMdda" /> 
<entry key="buildlabel" value="${builddate}_${buildnum}" /> 
</propertyfile> 
<property file="buildversion.properties" /> 
<echo message="Buildlabel is ${buildlabel}" /> 
<echo message="Builddate is ${builddate}" /> 
<echo message="Buildnum is ${buildnum}" /> 


output from ant build:

[propertyfile] Creating new property file:
/webapp/neo-gate/buildversion.properties
     [echo] Buildlabel is 19700101AM_0001
     [echo] Builddate is 19700101AM
     [echo] Buildnum is 0001


Just because I was curious, I did the following and it returned the date
correctly:

Am I missing something??

Thanks.

Nolan Ring


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message