Set 24-hour clock format in Jenkins
Asked Answered
T

2

19

Despite the fact that in http://<jenkins server>/systemInfo the user.timezone property value meets my actual time zone I still have 12-hour clock format.

enter image description here

I would like to have 24-hour clock format instead.

Does anyone have any ideas how it can be changed in Jenkins?

Thank you.

Tenaculum answered 3/7, 2014 at 20:59 Comment(1)
Jenkins uses the browsers language, if you have it set to english (US) then change it to english (GB)Alainaalaine
T
12

As @Arkain mentioned, you should specify in browser's settings the language which suits your intended time format. I had both English (US) and just English (which I thought was English (GB)), but then I realized that I should have added additional English (GB) language.

Thank you!

Tenaculum answered 4/7, 2014 at 11:19 Comment(4)
Hmm, this seems to work only on the individual job pages, not on the pipeline view, at least with Jenkins 1.554.1.Sweitzer
@PaŭloEbermann I believe that time format settings are applied for the whole Jenkins unless Pipeline plugin has it own settings. And yes, as a last resort you can try newer version of Jenkins.Tenaculum
@Jonny, please notice that the answer is about specifying a language in the browser, not the clock format. The time format is affected as a result of changing a language.Tenaculum
i tried setting US and DE web page selections in google chrome. it worked nicely on e.g. the Google search page but not at all for the Build History column of a Jenkins 2.235.5 install.Bicknell
A
3

Unfortunately, this situation hasn't changed and Jenkins' date display style is still linked to the browser language as of January 2016.

On a sidenote: There's a Locale Plugin, which supposedly allows to override Jenkins' default behaviour of picking up the locale via the browser language. Although - as Greg Dubicki noted - this plugin does process a language_country_variant string, only the language part (a 2-digit ISO 639-1 language code) has an effect, and it's only defining the UI langauge. The date display format still seems to be defined solely by the browser's language.

Adowa answered 26/1, 2015 at 11:23 Comment(3)
Actually Locale Plugin should accept and use "en_GB" setting correctly, according to its code: github.com/jenkinsci/locale-plugin/blob/master/src/main/java/… ... But in my case it doesn't. :(Cleanlimbed
Btw: "en_IE" locale would be a safer bet to get English & 24h-format, see: unix.stackexchange.com/questions/62316/…Cleanlimbed
for e.g. Ubuntu desktop or Windows: language of the UI is one item. date/time and currency formats are a separate item. sometimes dealing with them in a joint fashion can help solving some defaults. but sometimes you definitely want to override that. (BTW time zone is also something separate.)Bicknell

© 2022 - 2024 — McMap. All rights reserved.