2
   

insert current date, time, and weather onto my home page

 
 
sarnaud
 
Reply Wed 29 Sep, 2004 02:29 pm
Where can I find tutorials and source (code or wysiwyg) to insert current date, time, and weather onto my home page
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 1,702 • Replies: 2
No top replies

 
hingehead
 
  1  
Reply Thu 30 Sep, 2004 12:25 am
Depends what webserver your pages are on for date and time (also whether you want to state the date/time for your server or for the user using your server)

For server time on an IIS server in an ASP page you could just stick this in the body somewhere:

<%= Date() & " " & Time() %>


For client machine time I'd use javascript. This is a bit of code I wrote that says good morning, good afternoon or go home depending on the time:

<script language = 'JavaScript'><!--
//Figuring out what greeting to use by checking time on local PC
var date = new Date();
var hours = date.getHours();
if ( (hours < 8) || (hours > 17) )
{ document.write('Go home');}
else if ( (hours >7) && (hours < 12) )
{ document.write('Good morning');}
else if ( (hours >11) && (hours < 18) )
{ document.write('Good afternoon');}
//-->

You could get rid of the logic stuff and just use document.write to display 'date' and 'hours'
0 Replies
 
Craven de Kere
 
  1  
Reply Fri 1 Oct, 2004 03:29 am
Javascript date and time has a lot of copy/paste date and time scripts.

Weather is not something that can be determined by simple scripts, so you'd need to get weather information from somewhere.

Here are some leads: http://search.able2know.com/Web_Development/Content/Weather/index.html
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » insert current date, time, and weather onto my home page
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/17/2024 at 06:52:37