TimeStamp calculations

Discussion created by emladeira on Sep 10, 2012
Latest reply on Sep 12, 2012 by emladeira

I'm trying to diplay a Tag time delay using timestamp. It would be 'serverTime' - 'tagTime' and the result would be in minuts. I want to display in a label how many minuts is the delay from server. Ex. Server time: 10/09/2012 14:00:00, Tag Time: 10/09/2012 13:00:00 delay = 60 minuts 

Dim Timestring As String
    Dim PIServerTime As Long
    Dim Status As Long
    Dim Servertime As String * 19
    Dim Z As Long

Private Sub Display_DataUpdate()
    Timestring = ThisDisplay.endtime
    Status = pitm_parsetime(Timestring, 0, PIServerTime)
    If Status <> 0 Then
         lblTimestamp.Caption = " "
         Exit Sub
         End If
    pitm_formtime PIServerTime, Servertime, 19
Y = PISDK.GetPoint("\\server\tag").Data.Snapshot.TimeStamp
X = CDbl(Y)
z = PIServerTime - X
delay.Caption = z

'Part of the code from OSI Library
End Sub