Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. IMX6: Timezone invalid but available
Forum Updated to NodeBB v4.3 + New Features

IMX6: Timezone invalid but available

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 852 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.
  • A Offline
    A Offline
    acdc_1
    wrote on last edited by
    #1

    Hello,

    I am using QTimezone for choosing timzone from a combobox.
    The Combobox holds all items from QTimeZone:: availableTimeZoneIds();

    Now when i choos eg. Europe/Vienna

     QString zoneName = "Europe/Vienna ";
    QTimeZone zone(zoneName.toUtf8());
    
    qDebug()<<zone.isTimeZoneIdAvailable("Europe/Vienna "); //returns true
    qDebug()<<zone.isValid(); //returns false
    qDebug()<<zone.standardTimeOffset(QDateTime::currentDateTime()); //returns 0
    
    

    Is there anny mistake in using QTimeZone?
    Why is the Timezone available but invalid?
    With Timzone eg. "America/New_York" everything is ok.

    thanks

    jsulmJ 1 Reply Last reply
    0
    • A acdc_1

      Hello,

      I am using QTimezone for choosing timzone from a combobox.
      The Combobox holds all items from QTimeZone:: availableTimeZoneIds();

      Now when i choos eg. Europe/Vienna

       QString zoneName = "Europe/Vienna ";
      QTimeZone zone(zoneName.toUtf8());
      
      qDebug()<<zone.isTimeZoneIdAvailable("Europe/Vienna "); //returns true
      qDebug()<<zone.isValid(); //returns false
      qDebug()<<zone.standardTimeOffset(QDateTime::currentDateTime()); //returns 0
      
      

      Is there anny mistake in using QTimeZone?
      Why is the Timezone available but invalid?
      With Timzone eg. "America/New_York" everything is ok.

      thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @acdc_1 said in IMX6: Timezone invalid but available:

      "Europe/Vienna "

      You have a space after Europe/Vienna, remove it and try again.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • jsulmJ jsulm

        @acdc_1 said in IMX6: Timezone invalid but available:

        "Europe/Vienna "

        You have a space after Europe/Vienna, remove it and try again.

        A Offline
        A Offline
        acdc_1
        wrote on last edited by
        #3

        @jsulm thanks for your reply - this doesn't solve the problem.

        jsulmJ 1 Reply Last reply
        0
        • A acdc_1

          @jsulm thanks for your reply - this doesn't solve the problem.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @acdc_1 Maybe you should try toLatin1() instead of toUtf8()? I'm not sure whether QTimeZone expects to get ASCII or Unicode.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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