How can I get build time stamp of the latest build from Jenkins? I want to insert this value in the Email subject in post build actions.
You can use ${currentBuild. durationString} to get build duration.
The timestamp format can be configured via the Manage Jenkins, Configure System page. There is a panel on the left-hand side of the console page which allows either the system clock time or the elapsed time to be displayed. The time zone used to display the timestamps can be configured by setting a system property.
After installing the Timestamper Plugin, you have to configure each job by manually checking the "Add timestamps to the Console Output" option.
Build Timestamp Plugin will be the Best Answer to get the TIMESTAMPS
in the Build process.
Follow the below Simple steps to get the "BUILD_TIMESTAMP"
variable enabled.
STEP 1:
Manage Jenkins -> Plugin Manager -> Installed... Search for "Build Timestamp Plugin". Install with or without Restart.
STEP 2:
Manage Jenkins -> Configure System. Search for 'Build Timestamp' section, then Enable the CHECKBOX. Select the TIMEZONE, TIME format you want to setup with..Save the Page.
USAGE:
When Configuring the Build with ANT or MAVEN, Please declare a Global variable as, E.G. btime=${BUILD_TIMESTAMP} (use this in your Properties box in ANT or MAVEN Build Section) use 'btime' in your Code to any String Variables etc..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With