Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01

Question: TimeToStr seems to be 4 hours out. If I call TimeToStr(10,1) will return 4:00:10 PM. So if you do some calculations with the time variables and then want to convert it back to a readable time you must subtract 4 hours worth from your results. Is this correct? 

TimeToStr() is working correctly. You are calling this function incorrectly. When you use mode 1 the first argument must be a time variable, not the number of seconds from a calculation. You should be using modes 5, 7 or 8 if the argument is in number of seconds.

In version 3.00 and later if you use modes which expect a time variable (0,1,2,3,4) and the value is less than the number of seconds in a day, TimeToStr() will return an empty string.