<script>
var currentTime = new Date();
var futureTime = new Date(currentTime.getTime());
futureTime.setMinutes(futureTime.getMinutes() + 10);
var pastTime = new Date(currentTime.getTime());
pastTime.setMinutes(pastTime.getMinutes() - 50);
</script>
all I'm trying to do is if the current time is 6:00PM
, to display 50 minutes before then which is 5:10PM
and I'm also trying to display another time 10 minutes after the current time which is 6:10PM
.. How do I do this so it is formatted exactly as X:XXPM
?
I put the above code into my page and I see nothing at all..