Hahahhah This is actually getting to be very funny!
Ok I just changed that line (reversed the variables) , and still no go! Maby I have some sort of ghost in my machine! Everyone keeps telling me that it works, and It just will not work here. Here is what I have so far:
Try running this and see what you come up with. I have hardcoded the times, so there will be no dispute on what time it is on my machine, and the reported moonrise time.
When ran with the above times, From 9 in the morning to 1 in the afternoon is simply 4 hours, it is reporting 20.
The very bottom line is, there are 2 times, what is the difference in hours between them? How, just explain to me HOW something that should be SO simple can turn into all of this! I unplugged the computer, unhooked all the cables and stopped just short of throwing the computer out my 2nd floor window! ! !
Try that, it passed with the data you supplied.
Ok I just changed that line (reversed the variables) , and still no go! Maby I have some sort of ghost in my machine! Everyone keeps telling me that it works, and It just will not work here. Here is what I have so far:
Try running this and see what you come up with. I have hardcoded the times, so there will be no dispute on what time it is on my machine, and the reported moonrise time.
Code:
Dim CurrentTime
Dim Moonrise
Dim iDiff
Dim GetHourDif
sub main()
'CurrentTime = Time
CurrentTime = "01:21pm"
'Moonrise = hs.deviceString("m1")
Moonrise = "09:00am"
iDiff = DateDiff("H", CurrentTime, MoonRise)
If CInt(iDiff) < 0 Then
iDiff = iDiff + 24
End If
GetHourDif = iDiff
hs.setDeviceString "M4",GetHourDif
' Show the total number of hours that the moon has been up.
msgbox gethourdif
end sub
When ran with the above times, From 9 in the morning to 1 in the afternoon is simply 4 hours, it is reporting 20.
The very bottom line is, there are 2 times, what is the difference in hours between them? How, just explain to me HOW something that should be SO simple can turn into all of this! I unplugged the computer, unhooked all the cables and stopped just short of throwing the computer out my 2nd floor window! ! !