Option to remove AM/PM from clock in vertical panel (solution found)

I have an ultra-wide monitor and use a vertical panel on the left, just because it saves me a lot of screen space. However, the clock is very small. It could be scaled up a bit if the AM/PM was dropped. Personally, I have no need for it, as I can look and see if it is day or night. How hard would it be to make the AM/PM an option just as 12/24 hour is an option?

Thanks in advance.

1 Like

i second the addition of this check box, i don’t need the AM/PM, nor do i want to tend with a 24hr clock.

in the mean time i’ve found a font for my vertical panel that is the most readable but unfortunately the font selector doesn’t tell me what font i have selected once i hit apply.

i’ve tracked it down in my notes (pays to take good notes)

the font is montepetrum and can be downloaded from here

just unzip it and drag it to your fonts management window

the other thing i’ve noticed is that there is something about the default panel that puts extra padding right and left of the clock … so the the clock can display with less padding right and left if it’s placed into its own separate panel

it’s a bit tedious to set up but i have a separate panel the same width as my taskbar and put both the clock and minimize all windows widget in that panel by themselves… then just match the vertical heights so it appears to be one continuous panel (except for some minor gradient mismatch.


1 Like

It might be easier to just say if the panel is vertical, drop the AM/PM, since it really isn’t an issue on a horizontal panel.

As far as the date, I just use Custom and paste in the format code I prefer.

The “Split Digital Clock” widget on store.kde.org may help here.

1 Like

It sort of looks like what I would want, but it still leave the standard clock in the taskbar. I am not a coder, so I don’t know how to add a If verticalPanel statement in there, but I did manage to change DigitalClock.qml to

        // add "AM/PM" either if the setting is the default and locale uses it OR if the user unchecked "use 24h format"
        if ((main.use24hFormat == Qt.PartiallyChecked && !uses24hFormatByDefault) || main.use24hFormat == Qt.Unchecked) {
//            result += " " + amPm;
            result += " ";

and that got what I was looking for.

I found that I was also able to rem out the section and get the same result.

//        if ((main.use24hFormat == Qt.PartiallyChecked && !uses24hFormatByDefault) || main.use24hFormat == Qt.Unchecked) {
//            result += " " + amPm;
//        }


I realize I will have to make this change pretty often on Tumbleweed, but I know how now. :grinning:


Or just use 24-hour time format. No AM or PM there…


I could, but I would hate it. I would much rather just use 12 hour format and not see the AM or PM and have a clock that is readable for my old eyes. If it were a horizontal panel, the width of the clock would be insignificant.

We have a check box for 12/24 hour and a check box for Show Seconds. A check box for Show AM/PM would be a nice addition for those who might use a vertical panel. It could be a nice addition sometime down the road.


i like the split clock even less than i like the 24hr clock, but it does tend to solve the problem for vertical panels, worth checking out.

it even integrates with PIM services to show your calendar events.

Doesn’t that just use 24 h format? 12:07 is not 12h format.

Also I cannot reproduce with your code change. My clock just switches to 24h format if I apply your changes

1 Like

Yes, but I was not aware of it till the afternoon rolled around. :rofl:

Like I said, I am not a coder.


Very true, but I don’t want to add another clock. I already have one.

It does look good, but not on a vertical panel.

Haha, happens.

Actually it seems this is not a trivial problem. At least with my limited programming experience. But its a fun challenge. I doubt this will be up streamed, even if we figure it out.

I have looked at a lot of the clocks and they all want to split the hour and minutes to another line. The standard clock looks best, but it seems to just put the time in from the Regional Settings.

This has turned into something that does not belong in the Brainstorm section.

nothing earth shattering but for future ref i did find way to keep it on the 12hr clock while allowing the hh:mm to fill the full width of a vertical panel (task bar).


ground work: first of all the default panel (and kubuntu panel) both have extra padding that prevents the clock from fully using the width of a vertical panel, so the first thing to do is add a new blank panel and migrate all of your task bar widgets over to the new panel… this will give you a few extra pixels to work with.

the next bit, which is optional, is to download and install some narrow (condensed) fonts to play with from fontspace.com … i particularly like Bernound (shown), or Ignotum, but there the Uroob font that comes with kubuntu looks nice too.

the trick as you point out is to edit the


file, which will need to be repeated every time there is an update, but it is what it is.

around line 600 or so you will find the block of code that we need to modify

        // add "AM/PM" either if the setting is the default and locale uses it OR if the user unchecked "use 24h format"
        if ((main.use24hFormat == Qt.PartiallyChecked && !uses24hFormatByDefault) || main.use24hFormat == Qt.Unchecked) {
            result += "\n" + amPm;

note the substitution of the space character with the \n sting, this brings the AM/PM text onto a new line without disturbing the scripts ability to process the time format correctly as the 12hr format.

if you want to further minimize the visual impact of the AM/PM, you can also edit the definition of the amPm variable as so

var amPm = "a";

this will switch it to lower case and give a bit more visual space below the time value… note that the Ignotum font does not have lower case, and so defeats this mod.


so this workaround mod is working for me and has even allowed me to narrow my vertical task bar a bit more and still be able to read the clock.




I had not thought of putting a new line code in the space, even though I have it in a script that I wrote. I’m just not a coder, but you saved this one.

From what I can tell, Plasma just uses the code that comes from the locale and I have not found a way to strip it from there either, but just putting it on another line lets me make the clock much larger.

Thank you, thank you, thank you! @skyfishgoo I flagged your post so a mod would mark it as Solution.

Now, if the devs could code a way to only add this to a vertical panel, this would be a welcome feature.


@LandisTwo I saw you gave a post higher up a Heart. Please look at the post just above this one to see the solution that actually works. Down below is one that puts a permanent solution in your home directory.

1 Like

You should be able to do so, since you opened the thread.

1 Like

Yes, but I don’t see a way to do so. I could be overlooking it though.

That’d because it’s the Brainstorm category, only certain ones like Help have the solution feature :slight_smile:


Wait, that makes sense. Well, ignore the flag then. :smiley: