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 get integer from QTimeZone return value (enum)? [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

How to get integer from QTimeZone return value (enum)? [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
qtimezone
3 Posts 2 Posters 864 Views 2 Watching
  • 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
    RolBri
    wrote on last edited by RolBri
    #1

    Hey,

    I would like to use QTimeZone to check whether we have summer or winter time.
    Therefore QTimeZone shall take the current system time zone.

    I found QTimeZone::TimeType which looks like what I am looking for.
    It returns an enum, but I don´t know how to use the return value.

    Please see the code:

    QTimeZone myTimeZone = QTimeZone::systemTimeZone();
    int i= myTimeZone.TimeType; //Not working. How is it right?
    

    Thank you very much :-)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      Hi!

      const QDateTime now = QDateTime::currentDateTime();
      const bool isDaylightSavingTime = now.isDaylightTime();
      
      1 Reply Last reply
      0
      • R Offline
        R Offline
        RolBri
        wrote on last edited by
        #3

        Thank you very much :-)

        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