Please make a news post with this code:
Code: Select all
<div align="center"><script type="text/javascript">
/*
Annual Occasions Count Down script- By JavaScript Kit
For this and over 400+ free scripts, visit https://www.javascriptkit.com
This notice must stay intact
*/
var today=new Date()
//Enter the occasion's MONTH (1-12) and DAY (1-31):
var theoccasion=new Date(today.getFullYear(), 9, 21)
//Customize text to show before and on occasion. Follow grammer below:
var beforeOccasionText="until the 5th anniversarry"
var onOccasiontext="FIVE YEARS! ONE OF THE OLDEST SURVIVING RACING GAMES IN HISTORY!"
var monthtext=new Array("Jan","Feb","Mar","April","May","June","July","Aug","Sep","Oct","Nov","Dec")
theoccasion.setMonth(theoccasion.getMonth()-1) //change to 0-11 month format
var showdate="("+monthtext[theoccasion.getMonth()]+" "+theoccasion.getDate()+")" //show date of occasion
var one_day=1000*60*60*24
var calculatediff=""
calculatediff=Math.ceil((theoccasion.getTime()-today.getTime())/(one_day))
if (calculatediff<0){ //if bday already passed
var nextyeartoday=new Date()
nextyeartoday.setFullYear(today.getFullYear()+1)
calculatediff=Math.ceil((nextyeartoday.getTime()-today.getTime())/(one_day)+calculatediff)
}
//Display message accordingly
var pluraldayornot=(calculatediff==1)? "day" : "days"
if (calculatediff>0)
document.write("<b>"+calculatediff+" "+pluraldayornot+" "+beforeOccasionText+" "+showdate+"!</b>")
else if (calculatediff==0)
document.write("<b>"+onOccasiontext+" "+showdate+"!</b>")
</script></div>
Yes, this year Midtown Madness 2 will become 5 years old! It's not often you see a game last this long, so let's give it some more respect :D