I'm maintaining a turnkey application. The customer has requested a date/time setter which would allow the user to set time, date, and time zone. (Evidently, some of our units will be going into locations without any Internet access, so no NTP.)

Is it possible to programmatically access the Gnome graphical app for setting the date and time? This would save me a lot of time, plus it's exactly what the customer wants. Thanks for any guidance...

1 Answer 1


A co-worker found the answer:

system("gnome-control-center datetime");
  • The code above is C. You can put it almost literally anywhere you want to. Of course, you have to be running on a system with Gnome, but that was the premise of the original question. Hope this helps.
    – mzimmers
    Feb 21, 2021 at 22:35
  • You can't put it in a terminal running Ubuntu without a syntax error, so no, it is still unclear. Is your question even about Ubuntu, or is this a programming question that might be better suited on StackOverflow? You can use the edit link under your answer to improve your answer. The most helpful answers provide clear and explicit instructions. Don't just give a line of code, give us an example of how to use it. Composing your answer as a series of step-by-step instructions is a reliable way to make sure that your solution can be used by future visitors.
    – Nmath
    Feb 21, 2021 at 23:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .