IT Community - Software Programming, Web Development and Technical Support

detect hour of the day and selects a link, they go to either a day page or night page

This is a discussion on detect hour of the day and selects a link, they go to either a day page or night page within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone help me how can I detect the hour of the day, and then when someone selects ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 01-11-2008, 12:58 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 542
itbarota is on a distinguished road
Default detect hour of the day and selects a link, they go to either a day page or night page

Hi all...


Can anyone help me how can I detect the hour of the day, and then when someone selects a link, they go to either a "day" page or a "night" page


Thanks in advance...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 01-11-2008, 01:09 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 235
Pvinothkumar is on a distinguished road
Default Re: detect hour of the day and selects a link, they go to either a day page or night

Hi all...

<SCRIPT LANGUAGE = 'JavaScript'>
var date = new Date();
var hours = date.getHours();
if ( (hours < 6) || (hours > 18) )
document.write('<A HREF="night.html">click this link<\/A>');
else
document.write(<A HREF="day.html">click this link<\/A>');
</SCRIPT>

Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct Link To Any Page You Want To In Hotmail arjkhanna Search Engines 2 09-16-2009 08:31 PM
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 02:12 AM
How do you restrict page errors display in the JSP page? sundarraja ASP and ASP.NET Programming 1 02-07-2008 10:33 PM
How to change aspx page to html page? S.Vinothkumar ASP and ASP.NET Programming 4 10-26-2007 10:46 PM
ASP.NET FAQ - maintain page scroll position after a page postback? Archer ASP and ASP.NET Programming 1 07-23-2007 11:40 PM


All times are GMT -7. The time now is 09:59 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0