Djé Djé
Djé Djé

Reputation: 77

How to get easily timestamp in Jenkins Pipeline

I would like to get stage or step duration for some jobs in my Jenkins Pipeline.

I have no idea how to get the duration, so I decided to calculate it. For that, I would like to get timestamp with this format : 1624869043 (because it's easier to calculate with this format).

What is the easiest way to do that ?

Upvotes: 0

Views: 1115

Answers (2)

Ian W
Ian W

Reputation: 4777

Use the timestamps plugin, with elapsed option and precision milliseconds.

Upvotes: 1

Dmitriy Tarasevich
Dmitriy Tarasevich

Reputation: 1242

just use timestamp option in your pipeline

 options { timestamps() }

Upvotes: 0

Related Questions