Show DOY and UTC time along date

Hello,

is there some way to make the DOY and the UTC time appear beneath the standard clock in the center of the top bar?

That’d be quite helpful for my work; I haven’t found anything in settings, so I’m prepared to write my own Gnome extension for this purpose, but I haven’t been able to figure out where the date display actually comes from. It seems that it’s not generated by the shell but apparently in some C library, and there doesn’t seem to be a way to override this.

Any pointers?

Cheers,
Basti

Not in the top bar itself, but any “World Clocks” configured in GNOME Clocks show up in the calendar popover:

Screenshot of World Clocks in calendar

I don’t know what DOY is, but as you can see in the screenshot, UTC is supported.

If you really want to modify the display in the top bar, then you’ll have to indeed write an extension. You can check out the code from the above section (WorldClocksSection in dateMenu.js) to see how the labels are formatted. The TL;DR is calling Utils.formatTime() with an appropriate GLib.DateTime object.

I’m aware of world clocks, and I do in fact already have a UTC clock there. But I need UTC so often that opening the menu is becoming a nuisance.

DOY is “day of year”, i.e. it’s not another time zone and works clock, but a different way to format a date, e.g. like calendar week. I don’t think I can do that with world clocks can I?

I think I’ll go with an extension. Thanks for pointing me to the relevant code for date formatting.

Could you also give me some tips how to get a label into the top bar beneath the date? So far I’ve only ever used indicators in my extensions, but these are too far away from the date for this purpose :slightly_smiling_face:

Never mind, I’ve just written the extension :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.