In a recent question I asked what's the best practice for this kind of change. There was no answer yet. However, I can give you the recipe I am using, which has proven to work fine. All the programs pick the date up correctly.
My description is for Ubuntu, but will likely work on Debian and Mint.
Copy the locale you want to customize from
/usr/share/i18n/locales to a new file. E.g.
cp /usr/share/i18n/locales/de_DE /usr/share/i18n/locales/de_DE@isodate
Adjust all with the exception of the
LC_TIME sections to:
LC_TIME section to match your desired outcome. You can use the settings from my above linked question as a template. It looks like this is pretty much exactly what you want.
If your locale doesn't make use of "AM/PM" notation, set those to empty:
Making it known to the system
Edit the file
/var/lib/locales/supported.d/local and add the info about your locale definition there. I.e. add a line like this if your file name above was
isodate, adjust otherwise:
/var/lib/locales/supported.d/local doesn't exist, create a file of that name. Don't put your changes into the respective
de file in that folder, as they may get overwritten as soon as the
language-pack-* packages on your system receive an update.
# dpkg-reconfigure locales
In your case this will indicate that the
de_DE.UTF-8@isodate locale has been generated (assuming you have no syntax issues).
Last but not least add the following to
This will ensure that only
LC_TIME overrides the default locale defined using
Log in anew and you should be able to see the new ISO date/time when using
date or other tools using the respective libc runtime function.
The intent here is to make the least intrusive change while also not working against the system (e.g. against package manager and friends). Of course you can also simply create a copy of your locale, install it in a similar fashion as outlined above and then adjust
LANG. The point is, as long as you don't want to run the risk of your changes being overwritten by a package update, you have to use a customized copy (whatever customization you go for; i.e.
copy or simply keep the sections as they were in the original). And whether you change
LANG to point to the full customized locale definition - or whether you add
LC_TIME to point only to the relevant customized section of the same name of a customized locale definition file - you won't get around adjusting one of the global settings.