View Full Version : Anyone good in javascript?
Hi,
I need a simple javascript to write the current date we are...
It must be like:
March 31 2001
and it updates automatically daily...amnyone got one?
Thanks in advance http://bbs.adultwebmasterinfo.com/ubb/smile.gif
breest
03-31-2001, 02:46 AM
<script language="JavaScript">
days = new Array(7)
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
months = new Array(12)
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December"; today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear();
if (year < 2000)
year = year + 1900;
document.write ("<font size=+1 color=000000>" + month + " " + date + " " + year + "</font>")
// -- end hiding
</script>
Heh, somebody trying to create fake TGP ?Like : All galleries updated Today, ... http://bbs.adultwebmasterinfo.com/ubb/wink.gif
XM
Groovy
03-31-2001, 06:28 AM
i don't think rod wants to do that, it's also nice to just put it somewhere on your site, people like it.
Cyber-Fantasy
03-31-2001, 01:58 PM
another way
in head:<!-- Hide from JavaScript-Impaired Browsers
function initArray() {
for(i=0;i<initArray.arguments.length; i++)
this[i] = initArray.arguments[i];
}
var isnMonths=new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;
clcks=((sec<10)?"0":"")+sec;
clck=(hrs>=12)?"p.m.":"a.m.";
var stnr="";
var ns="0123456789";
var a="";
// End Hiding -->
in body where you want date
<!--Hide JavaScript from Java-Impaired Browsers
// fixes a Netscape 2 and 3 bug
function getFullYear(d) { // d is a date object
yr = d.getYear();
if (yr < 1000)
yr+=1900;
return yr;
}
document.write("<B> "+isnDays[today.getDay()]
+", "+isnMonths[today.getMonth()]+" "+today.getDate()+", "
+getFullYear(today)+"</B><br>");
// End hiding -->
just another way to accomplish the same thing
Thanks guys http://bbs.adultwebmasterinfo.com/ubb/smile.gif
But yes, I want to make a fake TGP....a CJ2 site lol http://bbs.adultwebmasterinfo.com/ubb/smile.gif
no seriously it's just to say that my CJ2 updates daily, that's all....it made my productivity 15% higher so http://bbs.adultwebmasterinfo.com/ubb/smile.gif
breest
04-01-2001, 04:01 AM
Wow! The date upped your prod that much? Im impressed.
-Breest
vBulletin® v3.7.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.