JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 6th, 2004, 12:05 PM
colcarn colcarn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 16 colcarn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 26 sec
Reputation Power: 0
Unhappy Server Date Display on HTML document

Ok i'm trying to grab the date from a specific IPaddress for a server. Can i modify the code below to do that or is there another way to easily accomplish this?

<script type="text/javascript">
var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday[d.getDay()] + "<br>")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getDate() + ", ")
document.write(d.getFullYear())
</script>

Reply With Quote
  #2  
Old October 6th, 2004, 12:32 PM
bocmaxima's Avatar
bocmaxima bocmaxima is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2004
Location: Tucson, Sonora
Posts: 1,371 bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level)bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level)bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level)bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level)bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level)bocmaxima User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 51 m 34 sec
Reputation Power: 50
Send a message via AIM to bocmaxima
Well, IP addresses don't have dates, just numbers.
JavaScript is client-side, so you can't get any server information from it. This means that it will always display the date and time relative to the client's computer settings.
You could always use getUTCDate

Hope that helps.

Reply With Quote
  #3  
Old October 6th, 2004, 12:38 PM
colcarn colcarn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 16 colcarn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 26 sec
Reputation Power: 0
Well crap. Thanks anyway.

Reply With Quote
  #4  
Old October 6th, 2004, 03:26 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,894 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 19 h 44 m 32 sec
Reputation Power: 4192
To get a server's date you'll need to use a server side language like PHP.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Server Date Display on HTML document

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap