I try to build a little web page to get some informations about my Jenkins Jobs and there Builds. The API is really nice so to get the informations is pretty easy.
But, if i request the timestamp for a build - i get something i cant handle with.
For example, I have build that was done on 09.04.2014 08:32:31 (in the Jenkins Web GUI) The returned timestamp of this date is "1397025151000".
If I convert this timestamp to date via PHP i get following:
echo (date("H:i:s - m.d.y", 1397025151000));
// result: 00:50:00 - 10.14.06
I couldnt finde anything about the timestamp in Jenkins - so maybe you can help me.
Thanks
Right idea with the unix timestamps. But Jenkins uses milliseconds for the unit, and not seconds. So you need to knock off the last few zeros which can be easily done by dividing by 1000. Then date
should be happier.
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