This plugin provides the build start timestamp as a parameter, which is great
The timestamp format isn’t easily configurable
Installation is again non-standard
The plugin notes say it’s a bit of a memory hog, and it was meant as a demo anyway
So I just wrote my own.
Formatted Date Parameter provides a confguration parameter (named build.formatted.timestamp), which during build will contain the build start timestamp. The timestamp format is ISO-1806 by default (“yyyy-MM-dd’T’HH:mmZ”). The timestamp format can be configured using another configuration parameter (named build.timestamp.format), which uses standard SimpleDateFormat syntax.
Copy the zip (see link at bottom of page) to the .BuildServer/plugins dir (for me it was /home/username/.BuildServer/plugins)
Restart the Tomcat instance your TeamCity WAR is deployed to.
Usage:
In my case, I wanted the week-in-year (01-52) to appear in the build number, so I
Added build.formatted.timestamp to the build number format field (build configuration -> general settings page)
Then I set the value of build.timestamp.format to show only the week number in 2 digits “ww” (build configuration -> build parameters page -> Add configuration parameter button)
Now my build number contains the current week number. Hurray.