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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting system date

Status
Not open for further replies.

msalvador

Programmer
Nov 13, 2001
33
0
0
IT
hi, there is a function to set system date
 
You mean to get the date to display on a webpage?? Sure there is:

<SCRIPT>
var mydate=new Date()
var theYear=mydate.getFullYear()
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym=&quot;0&quot;+daym
var dayarray=new Array(&quot;Sunday&quot;,&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;)
var montharray=new Array(&quot;01&quot;,&quot;02&quot;,&quot;03&quot;,&quot;04&quot;,&quot;05&quot;,&quot;06&quot;,&quot;07&quot;,&quot;08&quot;,&quot;09&quot;,&quot;10&quot;,&quot;11&quot;,&quot;12&quot;)
document.write(&quot;<font face='Geneva, Arial, Helvetica, san-serif'><h6>&quot;+dayarray[day]+&quot;<br>&quot;+montharray[month]+&quot;/&quot;+daym+&quot;/&quot;+theYear+&quot;</h6></font>&quot;)
//document.write(dayarray[day]+&quot;<br>&quot;+montharray[month]+&quot;/&quot;+daym+&quot;/&quot;+theYear)
</SCRIPT>

I use this on my site...they have others also... I have not failed; I merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top