5 Replies Latest reply on Feb 28, 2013 9:36 AM by AlistairFrith

    Displaying time from different timezones in PB

    AlistairFrith

      One of our customers has the following requirement for their PB displays:

       

      I want to be able to display the current time from a number of different countries on a Processbook page:

        • Geneva
        • Hong Kong
        • Singapore

       We also have access to AF, any ideas?

       

       

       

      I thought of the following 3 options, in increasing order of desirability:

      1. There is a ‘Timestamp’ type tag, which I have never used. It may be possible to define 24 of these but I am not sure how to populate them. Maybe there is a COM Connector that will talk to a time server? Seems a bit of a waste of a PI tag though!
      2.  Alternatively, you could always do it in VBA or with a ProcessBook addin. I would have it look through all the Text symbols for ones named something like “TimestampGMT-12” through “TimestampGMT+12” and populate their value with the appropriate time. This would then be called in the display on-update event handler.
      3.  I don’t think AF can help out of the box but I could be wrong. You could write a custom data reference whose configuration includes the GMT offset.
      Any other suggestions?
      --- Alistair.
        • Re: Displaying time from different timezones in PB
          Lonnie Bowling

          You could create a PE tag for each place.  The tag should be type timestamp and the equation is '*-4h', just change the hours to whatever offset you need.  That is only three tags.

           

          Lonnie

            • Re: Displaying time from different timezones in PB
              AlistairFrith

              A PE tag is a simple solution but I don't think it can cater for things like Daylight savings issues: There could potentially be periods of a few hours or days (or even months if one of the locations does not use daylight savings) where the calculated tag does not truly reflect local time at those locations. Really, we need to use a library that knows about these complications and can convert local time at one place to local time at another.

               

              However, a simple offset from the PI Server time may be adequate for the customer's needs and this PE method could easily be the 'best' solution. I have also implemented option 2 in a simple manner that again does not take into account Daylight Savings.

               

              --- Alistair.