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 can i change time zone?
Qt 6.11 is out! See what's new in the release blog

How can i change time zone?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.6k 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.
  • Y Offline
    Y Offline
    Yaldiz
    wrote on last edited by
    #1

    HI:

    I am using qt5 on embedded linux device.

    How can i change timezone for date and time manually?

    Thanks.

    JonBJ 1 Reply Last reply
    0
    • Y Yaldiz

      HI:

      I am using qt5 on embedded linux device.

      How can i change timezone for date and time manually?

      Thanks.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Yaldiz
      If you really want to change the (system) timezone, I don't think Qt libraries offer a call for that. You would need to do it via some other C++/OS-specific system call.

      If all you want to do is convert datetimes across timezones Qt has QTimeZone Class.

      1 Reply Last reply
      1
      • Y Offline
        Y Offline
        Yaldiz
        wrote on last edited by
        #3

        Is it possible for me to do this conversion using the QTimeZone class and make it permanent for the application?

        JonBJ 1 Reply Last reply
        0
        • Y Yaldiz

          Is it possible for me to do this conversion using the QTimeZone class and make it permanent for the application?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Yaldiz
          No, as I said there is no static void QTimeZone::setTimeZone() function.

          There are C library calls like tzset() which work off an (TZ?) environment variable you could alter. But I do not know which Qt or other libraries calls use that versus a more native timezone OS call.

          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