Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display the date?

Status
Not open for further replies.

rcbatlinux

Technical User
Mar 30, 2001
80
US
How can I show Today Date on my web page?
 
If you're using an asp page, just insert the followng <=date> where ever you want the date to appear. You will need to do it with an html editor, FP2000 will not allow it to my knowledge.
If you want to have it on your splash page, you will need to insert a java script. There are quite a few available on the net. Just enter &quot;java script date&quot; in a search engine, and get ready to count the responses.

Hope that helps.
Dick Rowland
 
This goes in between your <head> tags:


<script language=&quot;Javascript&quot;>
<!--
today=new Date();

// Build an array initializer
function isnArray() {
argnr=isnArray.arguments.length
for (var i=0;i<argnr;i++) {
this[i+1] = isnArray.arguments;
}
}

// And months and day arrays
var isnMonths=new isnArray(&quot;January&quot;,&quot;February&quot;,&quot;March&quot;,&quot;April&quot;,&quot;May&quot;,&quot;June&quot;,&quot;July&quot;,&quot;August&quot;,&quot;September&quot;,&quot;October&quot;,&quot;November&quot;,&quot;December&quot;);
var isnDays= new isnArray(&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;,&quot;Sunday&quot;);
isnDays[0]=&quot;Sunday&quot;;

function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}

// -->
</script>



Put his where ever you want the date to be displayed.

<script language=&quot;JavaScript&quot;>
<!--Hide JavaScript

var thisyear = today.getYear(); // varies in JavaScript and JScript

document.write(isnDays[today.getDay()]+&quot;, &quot;+isnMonths[today.getMonth()+1]+&quot; &quot;+today.getDate()+&quot;, &quot;)

if (thisyear >= 2000) { // covers JScript post 2000
document.write(thisyear);
}
else { // covers JScript from 1900 thru 1999 and JavaScript until 3899
document.write(1900 + thisyear);
} // not handled: JScript pre 1900

// End hiding of script -->


Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top