Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

WebVisu - displaying controller time (UTC) in local time

2020-07-07
2020-07-08
  • Tim.Manning - 2020-07-07

    I have to believe that someone has already figured this out, but I am a little bit stumped.

    I am using WebVisu, and I want to display a time stamp from the Controller on a WebVisu screen. The time stamp in the controller is UTC, but I need to display this time as the local time, based on the timezone on the user's PC.

    How do I do this? I am using Codesys 3.5 SP 15.

     
  • Morberis

    Morberis - 2020-07-08

    In the Oscat Basic library there is a function block called UTC_TO_LTIME that should be what you're looking for. It does allow for daylight savings time changes so you'll need to know if for a given timestamp if DST is active. Also in Oscat Basic is another function block called DST that will check for a given UTC if DST is active. It seems mislabelled in the documentation I have as DT2_TO_SDT.

    Oscat Basic
    https://store.codesys.com/oscat-basic.html

    Documentation
    http://www.oscat.de/images/OSCATBasic/oscat_basic333_en.pdf

     

    Last edit: Morberis 2020-07-08

Log in to post a comment.