A Date Countdown - JxPharmacy - Doc JavaScript | 2 | WebReference

A Date Countdown - JxPharmacy - Doc JavaScript | 2

Code (A Date Countdown)

<SCRIPT LANGUAGE="JavaScript">
<!--
// Copyright (c) 2000 internet.com Corp. 
// https://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.
var now = new Date();
var then = new Date("January 1, 2000");
var left = then.getTime() - now.getTime();
var days = Math.floor(left / (1000 * 60 * 60 * 24));
// var hours = Math.floor(left / (1000 * 60 * 60));
// var minutes = Math.floor(left / (1000 * 60));
// var seconds = Math.floor(left / 1000);
if (days > 1)
  document.write("Only " + days + " days left 'till the year 2000!")
else if (days == 1)
  document.write("Only one day left 'till the year 2000!")
else if (days == 0)
  document.write("Less than a day left 'till the year 2000!")
else // days 
  document.write("The year 2000 is history!");
// -->
</SCRIPT>

https://www.internet.com

Created: December 4, 1997
Revised: December 4, 1997
URL: https://www.webreference.com/js/pharmacy/countdowncode.html