Time Calculations without date
-
I have a user input field for time. I’m trying to calculate if the time the user entered is later than 8pm. However, because your code includes the date and time together, my code would have to be different for each day.
For example, this code works fine but ONLY for this specific day of the year:
Sept 6, 2019(function(){
if(fieldname38 > 435504) return “YES”;
if(fieldname38 <= 435504) return “NO”;
})();
how would I make this code work for any inputed day of the year?
thanks much!Fieldname38=
(function(){
var date1 = new Date(fieldname2*86400000),
s = ABS(date1)/1000,
h = FLOOR(s/3600);
m = (FLOOR((s%3600)/60)/60);
return h+m;
})()
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Time Calculations without date’ is closed to new replies.