Based on your examples, you actually have startingTime
and endingTime
in SECONDS, while you're comparing it to currentTime
in MILLISECONDS. Simply multiply the second-times by 1,000, like so:
if((currentTime>=startingTime*1000L)&&(currentTime<=endingTime*1000L))