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 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-11-2008, 01:58 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
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
Sponsored Links
  #2 (permalink)  
Old 01-11-2008, 02:09 AM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
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 On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/html-css-javascript-coding-techniques/4951-detect-hour-day-selects-link-they-go-either-day-page-night-page.html
Posted By For Type Date
HTML, CSS and Javascript Coding Techniques [Archive] - Page 2 - DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 03-10-2008 10:24 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 03:12 AM
How do you restrict page errors display in the JSP page? sundarraja ASP and ASP.NET Programming 1 02-07-2008 11:33 PM
How to change aspx page to html page? S.Vinothkumar ASP and ASP.NET Programming 4 10-26-2007 11:46 PM
ASP.NET FAQ - maintain page scroll position after a page postback? Archer ASP and ASP.NET Programming 1 07-24-2007 12:40 AM
How can I automatically load another page or reload the same page? Archer C# Programming 0 07-16-2007 12:10 AM


All times are GMT -7. The time now is 12:49 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0