• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    localDate, localTime and utcOffset

    BACnet4J general discussion
    3
    5
    1.6k
    Loading More Posts
    • 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.
    • carnecroC
      carnecro
      last edited by

      It looks like the properties localDate, localTime and utcOffset are modified in the device beforeReadProperty method. These properties are obviously derived from thy system clock and operating system setting.

      In our case, the device OS (Linux) is always running the clock in the UTC timezone even when the device is installed in another timezone. We would like to return the properties localDate, localTime and UTC offset to clients converted to the real device timezone.

      Is there any way how to do it except to subclass the DeviceObject and override beforeReadProperty?

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi carnecro,

        The LocalDevice has a setClock() method and TimeZone.getDefault() can be controlled via command line argument when launching Java. So, that may be able to avoid subclassing the DeviceObject, but may perhaps also be more cumbersome than have a subclass with all the modifications / setup you need in one place.

        1 Reply Last reply Reply Quote 0
        • K
          kishorevenki
          last edited by

          Hi phildunlap,

          I also face similar problem. My problem is

          • UTC_Offset set during creation of LocalDevice is not getting updated to the utc_offset property of the device. Though Simple Ack is received while writing the UTC_Offset property from 3rd party client, but when read it always responds with old value.. Here the expected behavior is UTC_Offset, should be updated.

          • When TimeSynch message is sent either via broadcast or to localDevice, the local date and time should change accordingly. But it always shows the system clock which is incorrect. I think carnecro is also facing the same issue.

          • Above issue is faced for UTCTime Synch as well. Here one more problem is UTC_Offset cannot be changed through BACnet. .

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            Hi kishorevenki,

            Maybe you could set some breakpoints and look into it? What have you tried so far?

            1 Reply Last reply Reply Quote 0
            • K
              kishorevenki
              last edited by

              Hi phildunlap,

              Based on your suggestion I did debugging.

              • UTC_Offset is getting updated when localDevice.writePropertyInternal(pid, value) during the initialize time. ;. After the analysis, I noticed that at 622nd line in BACnetObject.java ( l.propertyChange(pid, oldValue,, value) the value is right;y updated.

              • But when from 3rd property client ReadProprty (Device Object. UTC_Offset) is sent, the local device is returning the value of the timeZone and not with set value of UTC_Offset.. I could not debug using break point when asked from external device.with ReadProperty or other services. Please guide me where to set the break point, which will help me to debug and furnish you with more information.

              • Further I believe there is error in the value of UTC_Offset as per the time zone. For example if the time zone is - 7 hours, then the value of the UTC_Offset should be +420 and not -420. This is because as per BACnet local date / time is calculated based on the formula (GMT - UTC offset). So in the above example if UTC_Offset is -420 for - 7 hours. then the actual time would be if GMT equals 0;00 hours, 0 - (-420) equals 0 + 420 which means + 7 hours. and is wrong.

              Thanks,
              Kishore

              1 Reply Last reply Reply Quote 0
              • First post
                Last post