ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nolan Ring <Nolan.R...@Sun.Com>
Subject propertyfile task returning wrong date
Date Fri, 03 May 2002 12:26:35 GMT


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="" 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}" /> 
<property file="" /> 
<echo message="Buildlabel is ${buildlabel}" /> 
<echo message="Builddate is ${builddate}" /> 
<echo message="Buildnum is ${buildnum}" /> 

output from ant build:

[propertyfile] Creating new property file:
     [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

  <format property="BUILD_DATE" pattern="yyyyMMd" /> 

Am I missing something??


Nolan Ring

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

View raw message