Time Zone oparating

Forum Home Forums Understanding the Software Time Zone oparating

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9534
    Artos9
    Participant

    Hello,
    I have a question about Time Zone operating. My data is send to Rapid Scada in UTC.
    In interface layer I would like to convert UTC to TimeZone, it is possible?

    Thank you.

    #9535
    manjey73
    Participant

    double dtFromUtc(double utcTime)
    {
    var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
    return epoch.AddSeconds(utcTime).ToOADate();
    }

    Add to the Reference List of formulas that are not there. And in the input channel, use this formula with the Date, Time or Date and Time

    I don’t know if I understood correctly what you need

    • This reply was modified 3 weeks, 2 days ago by manjey73.
    #9537
    Mikhail
    Moderator

    Hi,
    It’s possible. Please provide a screenshot of the input channel properties that contains time.

    #9538
    Artos9
    Participant

    Hello,
    Thank you for answers.

    I meant about general showing data based on converted time.

    Process is:
    Measurements are made in Time Zone e.g. Moscow (+2 of UTC), next are converted to UTC and storage, next sent to SCADA by API and storage in UTC(.dat). Finally it think about showing with converting in ScadaWeb to another Time Zone e.g. Hong Kong( +8 of UTC).

    #9541
    manjey73
    Participant

    Well, you just need to add +8 hours to display in another Scada. The Scada variable itself is stored in double format and it is more convenient to already have a DateTime structure in it

    You can see how to add the clock directly to UTC time, it seems that everything is in seconds there. And add this addition to the formula above and only then convert to DateTime or store real UTC time in one cell and already perform conversions and show it in the pre-calculation one.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.