Getting Time And Date Values In Phing

10th June 2011 - 5 minutes read time

The tstamp task in Phing can be used to generate a timestamp that can be used anywhere within the current project. The default behaviour of tstamp is to create the properties DSTAMP, TSTAMP and TODAY, which contain time and date values. All you need to do is include the tstamp XML tag in your project somewhere.

  1. <tstamp>
  2. </tstamp>

The properties DSTAMP, TSTAMP and TODAY use the PHP strftime() function as a basis for formatting the time. The following table shows the value of each property.