You can use <tstamp/> task in Ant. Check the docs for more detail.