Javascript to display month/year (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


LB -> Javascript to display month/year (3/30/2001 17:31:00)

I'm looking through the normal resources, but what I need is a javascript that will display just the month and year:

March 20001

Does anyone have one handy?

Linda





Gil -> RE: Javascript to display month/year (3/30/2001 19:41:00)

I don't think will work for your example of 20001{/b}

But:
<!-- Begin
var months=new Array(13);
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";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year<100) year="19" + time.getYear();
else year=time.getYear();
document.write("<center>" + lmonth + " ");
document.write(date + ", " + year + "</center>");
// End -->
</SCRIPT>
</CENTER>
<!-- END OF SCRIPT -->

------------------
Gil Harvey
The Host Factory
Resellers are our speciality
"How Can I Miss You If You Won't Go Away? "





LB -> RE: Javascript to display month/year (3/30/2001 20:12:00)

lol. Somehow I don't think I'll need it to work until 20001... this should do it. Thanks, Gil.

Linda





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125