hexagon logo

Getting UTC date time in PCDMIS BASIC

I'm currently using the calls Date() and Time() in PCDMIS but I need UTC time. Are there calls for that? I can't find anything else in the Basic documentation.

Thanks

z

Parents
  • Simple Date + Time pop-up, I am not sure how to pull exactly UTC, I'm looking into it

    Sub Main
    
        MsgBox  Date & " " & Time
    
    End Sub


    Windows API Call

    Private Declare Sub GetSystemTime Lib "kernel32" (ByRef lpSystemTime As Any)
    
    Sub ShowUtcTime()
        Dim sysTime(7) As Integer  ' SYSTEMTIME struct: 8 WORDs (16-bit integers)
    
        GetSystemTime sysTime(0)
    
        Dim utcTime As String
        utcTime = Format(sysTime(0), "0000") & "-" & _
                  Format(sysTime(1), "00") & "-" & _
                  Format(sysTime(3), "00") & " " & _
                  Format(sysTime(4), "00") & ":" & _
                  Format(sysTime(5), "00") & ":" & _
                  Format(sysTime(6), "00")
    
        MsgBox "UTC Time: " & utcTime
    End Sub

Reply
  • Simple Date + Time pop-up, I am not sure how to pull exactly UTC, I'm looking into it

    Sub Main
    
        MsgBox  Date & " " & Time
    
    End Sub


    Windows API Call

    Private Declare Sub GetSystemTime Lib "kernel32" (ByRef lpSystemTime As Any)
    
    Sub ShowUtcTime()
        Dim sysTime(7) As Integer  ' SYSTEMTIME struct: 8 WORDs (16-bit integers)
    
        GetSystemTime sysTime(0)
    
        Dim utcTime As String
        utcTime = Format(sysTime(0), "0000") & "-" & _
                  Format(sysTime(1), "00") & "-" & _
                  Format(sysTime(3), "00") & " " & _
                  Format(sysTime(4), "00") & ":" & _
                  Format(sysTime(5), "00") & ":" & _
                  Format(sysTime(6), "00")
    
        MsgBox "UTC Time: " & utcTime
    End Sub

Children