This little JavaScript will take an occasion or date later on and contrast it with the present date, then show how long until that date/occasion happens. Really flawless! Loads of employments… (Marriage commencement, till school's out commencement, and so forth)

/*******************************************************

* MYCPLUS Sample Code - http://www.mycplus.com *

*

* This code is made accessible as a support of our *

* guests and is given entirely to the *

* reason for representation. *

*

* Please guide all request to saqib at mycplus.com *

*******************************************************/

<!- - ONE STEP TO INSTALL DAYS TILL DATE:

1. Add the first code to the BODY of your HTML archive - >

<!- - STEP ONE: Add the first code to the BODY of your HTML archive - >

<body>

<script LANGUAGE="JavaScript">

<!- - Original: Alan Palmer - >

<!- - Web Site: http://www.users.dircon.co.uk/~apalmer - >

<!- - Total Java Scripts 99 - Next Step Software- - >

<!- - Begin

var date = new Date("January 1, 2000");

var portrayal = "the year 2000";

var now = new Date();

var diff = date.getTime() - now.getTime();

var days = Math.floor(diff/(1000 * 60 * 60 * 24));

document.write("<center><h3>")

in the event that (days > 1) {

document.write(days + " days until " + portrayal);

}

else if (days == 1) {

document.write("Only two days until " + portrayal);

}

else if (days == 0) {

document.write("Tomorrow is " + depiction);

}

else {

document.write("It's" + depiction + "!");

document.write("</h3></center>");

}

/End - >

</script>

<!- - Script Size: 1.16 KB - >

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

/*******************************************************

* MYCPLUS Sample Code - http://www.mycplus.com *

*

* This code is made accessible as a support of our *

* guests and is given entirely to the *

* reason for representation. *

*

* Please guide all request to saqib at mycplus.com *

*******************************************************/

<!- - ONE STEP TO INSTALL DAYS TILL DATE:

1. Add the first code to the BODY of your HTML record - >

<!- - STEP ONE: Add the first code to the BODY of your HTML record - >

<body>

<script LANGUAGE="JavaScript">

<!- - Original: Alan Palmer - >

<!- - Web Site: http://www.users.dircon.co.uk/~apalmer - >

<!- - Total Java Scripts 99 - Next Step Software- - >

<!- - Begin

var date = new Date("January 1, 2000");

var portrayal = "the year 2000";

var now = new Date();

var diff = date.getTime() - now.getTime();

var days = Math.floor(diff/(1000 * 60 * 60 * 24));

document.write("<center><h3>")

in the event that (days > 1) {

document.write(days + " days until " + portrayal);

}

else if (days == 1) {

document.write("Only two days until " + portrayal);

}

else if (days == 0) {

document.write("Tomorrow is " + depiction);

}

else {

document.write("It's" + depiction + "!");

document.write("</h3></center>");

}

/End - >

</script>

<!- - Script Size: 1.16 KB -
 
Top