Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm specifically looking to change the formatting in two places:

On the desktop, the date/time reads "Sat 21:05". I would like it to read "23-Jul-11 21:05" or "23 Jul 11 21:05". In other words, I want to change the display of the day of week to display the day, short month name, and short year.

On the login screen, the date/time reads "Sat 9:06 PM". I would like to change it to either the same as the desktop ("23-Jul-11 21:05" or "23 Jul 11 21:05") or the preferred display of the full date in the format ("Saturday, 23 July 2011 21:05") where the full day, date, full month, full year, and time (in 24-hour format) is displayed.

I don't see any options to adjust this. I would suspect it's possible, but I'm not sure what config file it would be in or what options I would adjust.

share|improve this question

2 Answers 2

In Gnome3 you have two choices (neither of them, from what I can tell, currently will do all of what you are looking for):

1 Use the command line tool gsettings:

$ gsettings set org.gnome.shell.clock show-date true

2 Install Gnome Tweak Tool and activate the date that way.

It seems more customizable options haven't been implemented yet.

share|improve this answer
    
I noticed that if my screen is locked, it displays the same as on my desktop. I wonder if that can help me somehow. I know in GNOME2 there was a gdm user that affected the login screen, but I'm not sure if it exists in GNOME3 or how I would go about logging in to that user. –  Thomas Owens Jul 24 '11 at 9:41
3  
Apparently not. From the Arch Wiki article on GDM: "You can no longer use the gdmsetup command to configure GDM as of version 2.28. The command has been removed and GDM has been standardized and integrated with the rest of GNOME." wiki.archlinux.org/index.php/GDM –  jasonwryan Jul 24 '11 at 9:47
    
I just started Googling for accessing the GDM user and came across that page too. So changing the user settings to a 24-hour clock and activating the show-date wouldn't help me. As much as I like GNOME 3, this is kind of disappointing. –  Thomas Owens Jul 24 '11 at 9:49
2  
Gnome3 doesn't strike me as the sort of DE that encourages tinkering and customization... –  jasonwryan Jul 24 '11 at 9:59
    
jasonwryan has the right methodology, you just need to make sure to run the commands as root for the settings to affect the login screen. I used sudo gdm3setup.py to get things configured for me. (I'm running gdm 3.2.1.1) –  rbellamy Feb 1 '12 at 1:51

This used to be quite simple, all you had to do was edit the relevant gnome-shell js file:
/usr/share/gnome-shell/js/ui/dateMenu.js and change date/time format. As of v. 3.12 this is no longer a trivial task as shell js files come as a binary file and on top of that, the panel date/time code was moved to gnome-desktop. As a result, the date format is now hardcoded in gnome-wall-clock.c (see lines 284-331):

const char *format_string;

if (clock_format == G_DESKTOP_CLOCK_FORMAT_24H ||
    self->priv->ampm_available == FALSE) {
    if (show_full_date) {
        format_string = show_seconds ? _("%a %b %e, %R:%S")
            : _("%a %b %e, %R");
    } else if (show_weekday) {
        format_string = show_seconds ? _("%a %R:%S")
            : _("%a %R");
    } else {
        format_string = show_seconds ? _("%R:%S") : _("%R");
    }
} else {
    if (show_full_date) {
        format_string = show_seconds ? _("%a %b %e, %l:%M:%S %p")
            : _("%a %b %e, %l:%M %p");
    } else if (show_weekday) {
        format_string = show_seconds ? _("%a %l:%M:%S %p")
            : _("%a %l:%M %p");
    } else {
        format_string = show_seconds ? _("%l:%M:%S %p")
            : _("%l:%M %p");
    }
}

return date_time_format (now, format_string);

which means that, unless you patch the source code, there's no way to change the top panel date/time format.
The lock/login screen is still part of gnome-shell so the date & time format for that particular component could be customized (not trivial either). It is defined in
gnome-shell/js/ui/screenShield.js (at line 88):

let dateFormat = Shell.util_translate_time_string(N_("%A, %B %d"));

You could either write your own extension to override the default date format or use gresource to extract the shell js files, then modify that file and run your own shell version as per the linked tutorial.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.