Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How To Change Date and Time in windows from Qt Application
Forum Update on Monday, May 27th 2025

How To Change Date and Time in windows from Qt Application

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RamK
    wrote on 27 Jan 2015, 12:22 last edited by
    #1

    I want to know , how we can change system time from Qt application. I am using QDateTime with which we can get system time, is there any way to change the system time

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Jan 2015, 12:33 last edited by
      #2

      Hi and welcome to devnet,

      You can't as it's not something that is implemented (no matter what the platform) probably because it's an action that requires special privileges (i.e. root access).

      You can find more information "here":https://msdn.microsoft.com/en-us/library/ms724942(v=vs.85).aspx on what to use for Windows

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RamK
        wrote on 11 Feb 2015, 12:31 last edited by
        #3

        Thanks for the information. I will check on it .

        Is there any way in Qt with which we can detect time format change in system.
        I want to update my existing QDatetime value to reflect the same.

        example : if we change system time from 24hr to 12 hr format

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 12 Feb 2015, 00:33 last edited by
          #4

          Not that I know of, but since your on Windows you can use the winEventFilter function and implement the detection yourself

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved