I have been going in circles and gettng NOWHERE! I ah HORRIBLE with trying to add or subtract time.
I am working on a lunar calculation script/asp page.
I have 2 times, and I simply want to know the difference in hours between the 2 times. I am not using datedif, as the difference between the 2 times will ALWAYS be less than 24 hours, and that will just complicate things. Also the 2 variables I have to work with are the hour and the ampm state, and do not include the date. So I do NOT want to use date diff.
I simply need to know how many hours are between 2 times, given concideration to AM & PM.
For instance:
8 PM & 9 PM = 1 hour difference
8 PM & 12 AM = 4 hour difference
8 PM & 3 AM = 7 hour difference
11 AM & 1 AM = 14 hour difference
The last time will ALWAYS be after the first time, every time.
if anyone could probide a script snippit simply outputting a single variable holding the difference in time would be fantastic! EA: hourdif = 4
Any help with this is greatly appreceiated!
I am working on a lunar calculation script/asp page.
I have 2 times, and I simply want to know the difference in hours between the 2 times. I am not using datedif, as the difference between the 2 times will ALWAYS be less than 24 hours, and that will just complicate things. Also the 2 variables I have to work with are the hour and the ampm state, and do not include the date. So I do NOT want to use date diff.
I simply need to know how many hours are between 2 times, given concideration to AM & PM.
For instance:
8 PM & 9 PM = 1 hour difference
8 PM & 12 AM = 4 hour difference
8 PM & 3 AM = 7 hour difference
11 AM & 1 AM = 14 hour difference
The last time will ALWAYS be after the first time, every time.
if anyone could probide a script snippit simply outputting a single variable holding the difference in time would be fantastic! EA: hourdif = 4
Any help with this is greatly appreceiated!