Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help in programming use HTML/Javascript!!!

Status
Not open for further replies.

thomgun_lc

Member level 5
Member level 5
Joined
Jun 29, 2004
Messages
80
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
911
Hi, there i need a help about how to show the greetings such as "good morning" when we access the site at 7-12am, and good evening at 6-10pm??Need ur help??I need the source code, can anyone help me???
 

there are several options you can decide on:
- if the time is fixed onto server time -> server side programming (php, perl, asp, etc.)
- if the time is according to the user local time -> you can use client side (java script).
 

try the following

<!--
now = new Date

if (now.getHours() < 7) {
document.write("Good Evening!")
}
else if (now.getHours() < 12) {
document.write("Good morning!")
}
else if (now.getHours() < 18) {
document.write("Good Afternoon!")
}
else {
document.write("Good Evening!")
}
//-->
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top