Question

I am writing a simple snippet in KDevelop 4 to print the date of today, taking advantage of the Snippets feature and of the variable %{date}. The default format, however, is apparently MM/DD/YYYY, and I'd like to change it into YYYY-MM-DD. I have browsed over the Settings of both the Editor and the whole KDevelop, without luck. Can anyone point me to the relevant settings, if any exists?

I am using version 4, but I guess that's close to irrelevant (or is it?).

Was it helpful?

Solution

Found the answer in the KDE Help Center: %{date} is a Kate template macro (Kate is the editor used by KDevelop). Its expansion depends on the system locale, and there is no indication about a way to change the locale. By using other macros, however, I can obtain the desired result:

%{year}-%{month}-%{day}

For more complex cases, I suspect I'd need some more digging into the Kate Template Format, but the information so far satisfies my immediate need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top