Getting current timestamp in inline pipeline script using pipeline plugin of hudson

前端 未结 5 881
天命终不由人
天命终不由人 2021-01-01 17:02

I want to get Getting current timestamp in inline pipeline script using pipeline plugin of hudson. For setting up build display name.

Inline groovy script used:

5条回答
  •  抹茶落季
    2021-01-01 17:44

    you can also use this, I needed this in ms so:

    echo "TimeStamp: ${currentBuild.startTimeInMillis}"
    
    echo "TimeStamp: ${Util.getTimeSpanString(System.currentTimeMillis())}"
    

提交回复
热议问题