Announcement

Collapse
No announcement yet.

Script to compute Time Differential

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Script to compute Time Differential

    Hey Experts I am trying to write a script which computes the differential between two Times (days , hours, minutes, seconds). I am at a basic level here... I would simply like to have Homeseer save Time1 to a variable (e.g. when temperature is below freezing) , and Time2 to a different variable (e.g. when temperature rises above freezing) . Then I would like to compute the difference between the two variables (in minutes , hours , days, etc). Thank you in advance for assistance.

    #2
    Does this help?
    https://www.tutorialspoint.com/vbscr...cript_date.htm

    Comment


      #3
      Why not just use a timer in events?

      Greig.

      Sent from my SM-G950F using Tapatalk

      Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
      X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
      Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
      Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
      Scripts =
      Various

      Comment


        #4
        Since you are doing this in script, VB .Net has built in functions to do exactly what your want. Specifically the DateAdd function. Some specifics:

        https://docs.microsoft.com/en-us/dot...ramework-4.7.2

        Comment


          #5
          Or the DateDiff function: https://docs.microsoft.com/en-us/dot...ramework-4.7.2
          HS 3.0.0.548: 1990 Devices 1172 Events
          Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

          Comment

          Working...
          X