Does your second block of code mean the the first block doesn’t work (eg HOUR and MINUTE functions dont work as you said) or is this an alternative way to achieve a similar result?
According to the TIME function description, TIME = Hours x 100 + Minutes + secs/100. ie at time 14:30:30, TIME = 1430.30 If the description of TIME function is correct, I think your line 20 should be:
20 HOURS = INT ( TIME / 100 ) not = INT ( TIME / 3600 )
I dont understand is what units to define to get the 1430.3 format
Setting of units seems critical. How do I set units for ANY variable to show just a number - as in 1430.3? The best available option seems to be 55 “count” but this does not give the format for TIME described in the definition. I defined custom units = 68 “number”
I set up the following test code just now:
10 VAR1 = TIME (VAR1 units = 50 time) result 21:03:45 (actual time - ok)
20 VAR2 = TIME (VAR2 units = 55 counts) result 75825.000 = 21h, 3m, 45s in secs
30 VAR3 = TIME (VAR3 units = 48 hours, 47 minutes, 68 number) result 75825.000
40 VAR4 = TIME / 100 (VAR4 units = 47, 48, 68) result 758.250
I cannot find any “units” setting that displays the “correct” value of 2103.45.
I will try to work with the “total seconds” value which I can get.
This experiment suggests that the format described under TIME function (ie 1430.3) does not exist. Rather, when expressed as a number, TIME returns the number of seconds elapsed in the current day. From that, MINUTE and HOUR can be easily calculated as in your examples.
A general question - what “units” to use for a dimensionless number, eg result of an arithmetic calculation, which has no physical dimensions such as kg, degC??