HOME       >>       Websites and Web Designing

date for your site


wannabeeaweak

here this script will display the date for your user/visitors

input it in a html file in the head or body

<script language="Javascript">

<!--

/*

Today's date script

Visit java-scripts.net or

http://www.javascriptkit.com/ for this script

*/

 

var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")

 

var monName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")

 

var now = new Date

 

document.write("Today is " + dayName[now.getDay()] + ", " + monName[now.getMonth()] + " "+now.getDate() +".")

 

//-->

</script>


Bigyan

Don't you people ever get tired of writin these scripts ??I've written this script and seen this script atleast 20 times.Please stop writing these basic scripts


r3d1405241470

actually with php, i don't know what's the use of js. i don't even bother to learn it. this basic script show me what js can do, even if this script is really basic


bbdesign

Javascript will work on any browser that supports it because it is client-side. PHP only works on servers in which it is installed


Hercco

Javascript will work on any browser that supports it because it is client-side. PHP only works on servers in which it is installed

<{POST_SNAPBACK}>


And which do you think is best?

 

As a web designer, with which one you know that user is seeing a date?

 

 

And R3d Javascript is really worth learning. It isn't the best technology to get a date or time to your website but you can do lot of stuff that are really useful for your visitors. A typical example is manipulating form data on client side. For example, it is extremely useful to be able to check/uncheck all checkboxes at once.

My view is that Javascript shouldn't be used to replace server-side stuff but to do stuff that are useful (ie. not just flashy) but not possible or very clumsy with server-side program.


avalon1405241471

The problem with JS is that it rely the user computer time, if the user computer date and time is not adjusted then the time showing will be inaccurate.For PHP it read the server time, no matter what date and time setting is made on the user computer the result will remain consistent and unaffected by the user computer setting.Most users will have no problem viewing becos PHP will return the time and date in plain text format whereas JS may have problem with users who choose to disable JS for security reasons and older browser that do not support JS.Hope the above explainations will help you to see what want you are choosing and what to expect.


lhunath

Don't you people ever get tired of writin these scripts ??

I've written this script and seen this script atleast 20 times.

 

Please stop writing these basic scripts

<{POST_SNAPBACK}>

Thank you finally somebody who agrees with me.

 

Even though I doubt he wrote it. I'm sure he copy pasted it from somewhere... *sigh*



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.