Displaying an Image Link for a Limited Time
I'm trying to get an image link to display for 24 hours on my site. This is what I have so Far, what am I doing wrong?
<script type="text/javascript">
window.setInterval(function(){
var current = new Date();
var linkOneStartDate = new Date("March 6, 2019 12:57:15")
var linkOneExpirationDate = new Date("March 7, 2019 12:58:00")
if (current.getTime() > linkOneStartDate.getTime()) && current.getTime() < linkOneExpirationDate.getTime()) {
$('#linkOne').show();
}
else {
$('#linkOne').hide();
}
});
</script>
<div id="linkOne" style="display:none">
</div>
</div>