[Javascript] How do I insert the actual (not user's computer) date with javascript (no ASP)?

Esther_Strom at hmco.com Esther_Strom at hmco.com
Wed Nov 21 11:28:26 CST 2001


Doesn't this all work based on the system clock (meaning the user's machine
clock)? I've never heard of a way to get the server date without using some
kind of server-side scripting.

Esther


                                                                                                                       
                    "Cutter Bl"                                                                                        
                    <cutterbl at hotmail        To:     javascript at LaTech.edu                                             
                    .com>                    cc:                                                                       
                    Sent by:                 Subject:     Re: [Javascript] How do I insert the actual (not user's      
                    javascript-admin@        computer) date with javascript (no ASP)?                                  
                    LaTech.edu                                                                                         
                                                                                                                       
                                                                                                                       
                    11/21/01 11:16 AM                                                                                  
                    Please respond to                                                                                  
                    javascript                                                                                         
                                                                                                                       
                                                                                                                       




<script>


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


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


now = new Date


</script>


// Stuff


<script>


document.write("<h1>Today is " + dayName[now.getDay()]  + ", " +
monName[now.getMonth()] + " " + now.getDate() + ".<\/h1>")


</script>


 From Javascript for the World Wide Web Fourth Edition, Negrino & Smith,
Peachpit Press



Cutter
Falcon Knives

----Original Message Follows----
[Javascript] How do I insert the actual (not user's computer) date with
javascript (no ASP)?
Date: Wed, 21 Nov 2001 16:50:22 -0000
I am looking to insert the actual date on a page that would update
based on the server date or atomic clock date or something with a
quick javascript or something. I don't have ASP so I can't use the
date() object or whatever.
Please help!
Thanks,
Bobby
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript

Get your FREE download of MSN Explorer at http://explorer.msn.com
_______________________________________________ Javascript mailing list
Javascript at LaTech.edu http://www.LaTech.edu/mailman/listinfo/javascript






More information about the Javascript mailing list